提交 b40b7a90 编写于 作者: A Alan Stern 提交者: Greg Kroah-Hartman

[PATCH] USB hub: don't return status > 0 from resume

finish_device_resume() in the hub driver isn't careful always to return
a negative code in all the error pathways.  It also doesn't return 0 in
all the success pathways.  This patch (as724) fixes the behavior.
Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 eecd11ed
......@@ -1790,7 +1790,10 @@ static int finish_device_resume(struct usb_device *udev)
* and device drivers will know about any resume quirks.
*/
status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus);
if (status < 2)
if (status >= 0)
status = (status == 2 ? 0 : -ENODEV);
if (status)
dev_dbg(&udev->dev,
"gone after usb resume? status %d\n",
status);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册