Commit 4f053a24eca933ec10ce68eef61d38d179f34e50
Committed by
Felipe Balbi
1 parent
000b7f5127
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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>
Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff
drivers/usb/renesas_usbhs/mod_host.c
... | ... | @@ -334,6 +334,11 @@ |
334 | 334 | struct device *dev = usbhs_priv_to_dev(priv); |
335 | 335 | unsigned long flags; |
336 | 336 | |
337 | + if (unlikely(!uep)) { | |
338 | + dev_err(dev, "no uep\n"); | |
339 | + return; | |
340 | + } | |
341 | + | |
337 | 342 | /******************** spin lock ********************/ |
338 | 343 | usbhs_lock(priv, flags); |
339 | 344 |