From: Kuninori Morimoto Date: Wed, 17 Oct 2012 06:31:33 +0000 (-0700) Subject: usb: renesas_usbhs: fixup: avoid NULL access on error case pipe detach X-Git-Tag: v3.7-rc6~9^2~6^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f053a24eca933ec10ce68eef61d38d179f34e50;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git 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 Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/renesas_usbhs/mod_host.c b/drivers/usb/renesas_usbhs/mod_host.c index 9b69a13..069cd76 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);