From: Colin Leroy Date: Sun, 1 May 2005 09:29:10 +0000 (+0200) Subject: [PATCH] USB: check for device in zd1201_resume X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f58f97fa9d258e4110ee1257a63cd1af51787f69;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [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: Colin Leroy Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/net/zd1201.c b/drivers/usb/net/zd1201.c index eb0bff535b3..3b387b00573 100644 --- a/drivers/usb/net/zd1201.c +++ b/drivers/usb/net/zd1201.c @@ -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)