[PATCH] USB: fix missed resume for auto-suspend failed interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If one usb interface driver returns failure from its
suspend(auto) callback inside usb_suspend_both, its
resume() callback should be called to recover its
working state.

Unfortunately, usbcore missed it, so fix the bug by
decreasing the iterator variable to cover the current
failed interface.

Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxxxxx>
---
 drivers/usb/core/driver.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index ddd820d..c228c9c 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1250,8 +1250,10 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
 			/* Ignore errors during system sleep transitions */
 			if (!PMSG_IS_AUTO(msg))
 				status = 0;
-			if (status != 0)
+			if (status != 0) {
+				i--;
 				break;
+			}
 		}
 	}
 	if (status == 0) {
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux