ray_cs: avoid potential null dereference in ray_get_wireless_stats
PATCH 1/1 ray_cs: avoid potential null dereference in ray_get_wireless_stats
http://bugzilla.kernel.org/show_bug.cgi?id=13854
Reported-by Martin Ettl <[email protected]>
Signed-off-by John W. Linville <[email protected]>
--- drivers/net/wireless/ray_cs.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/ray_cs.c +4 -2
@@ -1508,11 +1508,13 @@ static int ray_commit(struct net_device *dev, struct iw_request_info *info, /* Nstatic iw_stats *ray_get_wireless_stats (struct net_device *dev) {ray_dev_t *local =netdev_priv (dev); -struct pcmcia_device *link = local->finder; -struct status __iomem *p = local->sram +STATUS_BASE ; +struct pcmcia_device *link; +struct status __iomem *p;if (local == (ray_dev_t *)NULL )return (iw_stats *)NULL ; + link = local->finder; + p = local->sram +STATUS_BASE ; local->wstats.status = local->card_status;#ifdef WIRELESS_SPY
Signature · 1 line
1.6.2.5
PATCH 1/1 ray_cs: remove bocus NULL check at head of ray_get_wireless_stats
Reported-by Johannes Berg <[email protected]>
Cc Martin Ettl <[email protected]>
Signed-off-by John W. Linville <[email protected]>
---
Johannes points-out that the NULL check is mostly bogus given how netdev_priv is computed and how get_wireless_stats gets called...
drivers/net/wireless/ray_cs.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
drivers/net/wireless/ray_cs.c +0 -3
@@ -1511,9 +1511,6 @@ static iw_stats *ray_get_wireless_stats(struct net_device *dev)struct pcmcia_device *link = local->finder;struct status __iomem *p = local->sram +STATUS_BASE ; -if (local == (ray_dev_t *)NULL ) -return (iw_stats *)NULL ; - local->wstats.status = local->card_status;#ifdef WIRELESS_SPY if ((local->spy_data.spy_number > 0)
Signature · 1 line
1.6.2.5