Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f053a24 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Felipe Balbi
Browse files

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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 000b7f51
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);