diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2011-04-21 01:10:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-29 20:24:32 -0400 |
commit | 9a28b7bd4f1fb388a15b12fb425a589ba6188425 (patch) | |
tree | 7422c797f8d6d0ee64bfc11b3dbcb6e8355393e5 /drivers/usb/renesas_usbhs | |
parent | cb96632c185f13f746d009ec1125539e0b5cd899 (diff) |
usb: renesas_usbhs: return error if wrong recip request
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>
Diffstat (limited to 'drivers/usb/renesas_usbhs')
-rw-r--r-- | drivers/usb/renesas_usbhs/mod_gadget.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index d027c80ab35..206cfabc928 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c | |||
@@ -583,6 +583,10 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv, | |||
583 | char *msg; | 583 | char *msg; |
584 | 584 | ||
585 | uep = usbhsg_gpriv_to_nth_uep(gpriv, nth); | 585 | uep = usbhsg_gpriv_to_nth_uep(gpriv, nth); |
586 | if (!usbhsg_uep_to_pipe(uep)) { | ||
587 | dev_err(dev, "wrong recip request\n"); | ||
588 | return -EINVAL; | ||
589 | } | ||
586 | 590 | ||
587 | switch (recip) { | 591 | switch (recip) { |
588 | case USB_RECIP_DEVICE: | 592 | case USB_RECIP_DEVICE: |