Skip to content

Commit

Permalink
usb: renesas_usbhs: return error if wrong recip request
Browse files Browse the repository at this point in the history
There are some USB Host which doesn't notice disconnection at once.
And it might try some request after reconnection with old settings.
Current renesas_usbhs will crash in such case.
This patch prevent this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Kuninori Morimoto authored and Greg Kroah-Hartman committed Apr 30, 2011
1 parent cb96632 commit 9a28b7b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/usb/renesas_usbhs/mod_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,10 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv,
char *msg;

uep = usbhsg_gpriv_to_nth_uep(gpriv, nth);
if (!usbhsg_uep_to_pipe(uep)) {
dev_err(dev, "wrong recip request\n");
return -EINVAL;
}

switch (recip) {
case USB_RECIP_DEVICE:
Expand Down

0 comments on commit 9a28b7b

Please sign in to comment.