Skip to content

Commit

Permalink
hostap_cs: correct poor NULL checks in suspend/resume routines
Browse files Browse the repository at this point in the history
This corrects this kernel.org bug:

	http://bugzilla.kernel.org/show_bug.cgi?id=9701

Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
John W. Linville committed Jul 7, 2008
1 parent 7f2d38e commit fcee7a0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/net/wireless/hostap/hostap_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);

Expand Down

0 comments on commit fcee7a0

Please sign in to comment.