Skip to content

Commit

Permalink
USB: driver.c: processing failure, maching resume condition with susp…
Browse files Browse the repository at this point in the history
…end condition

  when suspend, it need check 'udev->actconfig'.
  so when process failure, also need check it.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Chen Gang authored and Greg Kroah-Hartman committed Apr 1, 2013
1 parent 8e277d7 commit 505bdbc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/usb/core/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 505bdbc

Please sign in to comment.