summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2008-07-02 11:04:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-07-07 15:22:53 -0400
commitfcee7a01ad7516eeb8dfdd0a17ef04cd2ee30757 (patch)
tree15b71fcba6b899d065b133499ebc48afbf97a1f2 /drivers
parent7f2d38eb7a42bea1c1df51bbdaa2ca0f0bdda07f (diff)
downloadlinux-fcee7a01ad7516eeb8dfdd0a17ef04cd2ee30757.tar.gz
linux-fcee7a01ad7516eeb8dfdd0a17ef04cd2ee30757.tar.bz2
linux-fcee7a01ad7516eeb8dfdd0a17ef04cd2ee30757.zip
hostap_cs: correct poor NULL checks in suspend/resume routines
This corrects this kernel.org bug: http://bugzilla.kernel.org/show_bug.cgi?id=9701 Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index 80039a0ae027..3b4e55cf33cd 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -777,8 +777,10 @@ static int hostap_cs_suspend(struct pcmcia_device *link)
int dev_open = 0;
struct hostap_interface *iface = NULL;
- if (dev)
- iface = netdev_priv(dev);
+ if (!dev)
+ return -ENODEV;
+
+ iface = netdev_priv(dev);
PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_SUSPEND\n", dev_info);
if (iface && iface->local)
@@ -798,8 +800,10 @@ static int hostap_cs_resume(struct pcmcia_device *link)
int dev_open = 0;
struct hostap_interface *iface = NULL;
- if (dev)
- iface = netdev_priv(dev);
+ if (!dev)
+ return -ENODEV;
+
+ iface = netdev_priv(dev);
PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_RESUME\n", dev_info);