From: Kuninori Morimoto Date: Mon, 10 Dec 2012 05:06:37 +0000 (-0800) Subject: usb: renesas_usbhs: mod_host: fixup usbhsh_ureq_free() timing X-Git-Tag: v3.8-rc4~25^2~17^2~7 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=e0b64ce6fe0a9d4ce8cf97fea7fe5ec7125dea30;p=linux.git usb: renesas_usbhs: mod_host: fixup usbhsh_ureq_free() timing usbhsh_ureq_free() free ureq which includes ubshs_pkt. But current driver used usbhs_pkt after freed ureq. This patch fixup this bug. Special thanks to Chen Reported-by: Chen Gang Signed-off-by: Kuninori Morimoto Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/renesas_usbhs/mod_host.c b/drivers/usb/renesas_usbhs/mod_host.c index 3d3cd6ca2689..b86815421c8d 100644 --- a/drivers/usb/renesas_usbhs/mod_host.c +++ b/drivers/usb/renesas_usbhs/mod_host.c @@ -661,9 +661,10 @@ static void usbhsh_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt) status = -ESHUTDOWN; urb->actual_length = pkt->actual; - usbhsh_ureq_free(hpriv, ureq); usbhsh_endpoint_sequence_save(hpriv, urb, pkt); + usbhsh_ureq_free(hpriv, ureq); + usbhsh_pipe_detach(hpriv, usbhsh_ep_to_uep(urb->ep)); usb_hcd_unlink_urb_from_ep(hcd, urb);