summaryrefslogtreecommitdiffstats
path: root/drivers/usb/renesas_usbhs/mod_host.c
diff options
context:
space:
mode:
authorKuninori Morimoto2012-10-17 08:31:33 +0200
committerFelipe Balbi2012-10-23 08:44:08 +0200
commit4f053a24eca933ec10ce68eef61d38d179f34e50 (patch)
treec2fe9ec27d22d8595672c0100dd8c70895f96480 /drivers/usb/renesas_usbhs/mod_host.c
parentusb: gadget: net2272: fix missing unlock on error in net2272_irq() (diff)
downloadkernel-qcow2-linux-4f053a24eca933ec10ce68eef61d38d179f34e50.tar.gz
kernel-qcow2-linux-4f053a24eca933ec10ce68eef61d38d179f34e50.tar.xz
kernel-qcow2-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.c5
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);