Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 505bdbc7 authored by Chen Gang's avatar Chen Gang Committed by Greg Kroah-Hartman
Browse files

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: default avatarChen Gang <gang.chen@asianux.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8e277d7c
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1253,11 +1253,13 @@ 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) {
		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
	 * and flush any outstanding URBs.