From: Alan Stern Date: Mon, 10 Jul 2006 11:44:47 +0000 (-0700) Subject: [PATCH] usb-storage: wait for URB to complete X-Git-Tag: v3.12-rc1~34698 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d6b7d3b62069be60d5b13358bac8670dacdd7a81;p=kernel%2Fkernel-generic.git [PATCH] usb-storage: wait for URB to complete We all failed to notice that Franck's recent update to usb-storage allowed an URB to complete after its context data was no longer valid. This patch (as746) makes the driver wait for the URB to complete whenever there's a timeout. Although timeouts in usb-storage are relatively uncommon, they do occur. Without this patch the code in 2.6.18-rc1 will fault within an interrupt handler, which is not nice at all. Signed-off-by: Alan Stern Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c index eb7188b..d6acc92 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c @@ -180,7 +180,7 @@ static int usb_stor_msg_common(struct us_data *us, int timeout) if (timeleft <= 0) { US_DEBUGP("%s -- cancelling URB\n", timeleft == 0 ? "Timeout" : "Signal"); - usb_unlink_urb(us->current_urb); + usb_kill_urb(us->current_urb); } /* return the URB status */