Commit f58f97fa authored by Colin Leroy's avatar Colin Leroy Committed by Greg Kroah-Hartman

[PATCH] USB: check for device in zd1201_resume

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: default avatarColin Leroy <colin@colino.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a3c900bb
...@@ -1905,6 +1905,9 @@ static int zd1201_resume(struct usb_interface *interface) ...@@ -1905,6 +1905,9 @@ static int zd1201_resume(struct usb_interface *interface)
{ {
struct zd1201 *zd = usb_get_intfdata(interface); struct zd1201 *zd = usb_get_intfdata(interface);
if (!zd || !zd->dev)
return -ENODEV;
netif_device_attach(zd->dev); netif_device_attach(zd->dev);
if (zd->was_enabled) if (zd->was_enabled)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment