diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2012-10-16 23:31:33 -0700 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-10-23 09:44:08 +0300 |
commit | 4f053a24eca933ec10ce68eef61d38d179f34e50 (patch) | |
tree | c2fe9ec27d22d8595672c0100dd8c70895f96480 /drivers/usb/renesas_usbhs/mod_host.c | |
parent | 000b7f5127900f695668191353a3291832c1914e (diff) | |
download | blackbird-obmc-linux-4f053a24eca933ec10ce68eef61d38d179f34e50.tar.gz blackbird-obmc-linux-4f053a24eca933ec10ce68eef61d38d179f34e50.zip |
usb: renesas_usbhs: fixup: avoid NULL access on error case pipe detach
If renesas_usbhs or DMAEngine interrupt didn't happen by a certain cause,
urb->ep will be NULL by usb time out.
Then, host mode will access to it and crash kernel.
This patch fixes it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/renesas_usbhs/mod_host.c')
-rw-r--r-- | drivers/usb/renesas_usbhs/mod_host.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/renesas_usbhs/mod_host.c b/drivers/usb/renesas_usbhs/mod_host.c index 9b69a1323294..069cd765400c 100644 --- a/drivers/usb/renesas_usbhs/mod_host.c +++ b/drivers/usb/renesas_usbhs/mod_host.c @@ -334,6 +334,11 @@ static void usbhsh_pipe_detach(struct usbhsh_hpriv *hpriv, struct device *dev = usbhs_priv_to_dev(priv); unsigned long flags; + if (unlikely(!uep)) { + dev_err(dev, "no uep\n"); + return; + } + /******************** spin lock ********************/ usbhs_lock(priv, flags); |