diff options
author | Kuninori Morimoto | 2011-04-21 14:10:12 +0900 |
---|---|---|
committer | Greg Kroah-Hartman | 2011-04-29 17:24:32 -0700 |
commit | 9a28b7bd4f1fb388a15b12fb425a589ba6188425 (patch) | |
tree | 7422c797f8d6d0ee64bfc11b3dbcb6e8355393e5 | |
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>
-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 d027c80ab359..206cfabc9286 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, 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: |