Skip to content

Commit

Permalink
usb: renesas_usbhs: fixup: avoid NULL access on error case pipe detach
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kuninori Morimoto authored and Felipe Balbi committed Oct 23, 2012
1 parent 000b7f5 commit 4f053a2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/usb/renesas_usbhs/mod_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 4f053a2

Please sign in to comment.