From: Chen Gang Date: Mon, 1 Apr 2013 05:04:08 +0000 (+0800) Subject: USB: driver.c: processing failure, maching resume condition with suspend condition X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=505bdbc79d20f8f2a56c02498f079bb23b0ef756;p=linux-beck.git USB: driver.c: processing failure, maching resume condition with suspend condition when suspend, it need check 'udev->actconfig'. so when process failure, also need check it. Signed-off-by: Chen Gang Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 84d2b0585810..6eab440e1542 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -1253,10 +1253,12 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) /* If the suspend failed, resume interfaces that did get suspended */ if (status != 0) { - msg.event ^= (PM_EVENT_SUSPEND | PM_EVENT_RESUME); - while (++i < n) { - intf = udev->actconfig->interface[i]; - usb_resume_interface(udev, intf, msg, 0); + if (udev->actconfig) { + msg.event ^= (PM_EVENT_SUSPEND | PM_EVENT_RESUME); + while (++i < n) { + intf = udev->actconfig->interface[i]; + usb_resume_interface(udev, intf, msg, 0); + } } /* If the suspend succeeded then prevent any more URB submissions