Skip to content

Commit

Permalink
[PATCH] USB: check for device in zd1201_resume
Browse files Browse the repository at this point in the history
My patch adding PM support for zd1201 didn't check for the device on
resume, which can oops if the device has been removed.

This patch fixes it.

Signed-off-by: Colin Leroy <colin@colino.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Colin Leroy authored and Greg Kroah-Hartman committed Jun 27, 2005
1 parent a3c900b commit f58f97f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/usb/net/zd1201.c
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,9 @@ static int zd1201_resume(struct usb_interface *interface)
{
struct zd1201 *zd = usb_get_intfdata(interface);

if (!zd || !zd->dev)
return -ENODEV;

netif_device_attach(zd->dev);

if (zd->was_enabled)
Expand Down

0 comments on commit f58f97f

Please sign in to comment.