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-Url: https://git.stricted.de/?a=commitdiff_plain;h=4f053a24eca933ec10ce68eef61d38d179f34e50;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.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 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);