summaryrefslogtreecommitdiffstats
path: root/drivers/usb/renesas_usbhs
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-04-21 14:10:12 +0900
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-29 17:24:32 -0700
commit9a28b7bd4f1fb388a15b12fb425a589ba6188425 (patch)
tree7422c797f8d6d0ee64bfc11b3dbcb6e8355393e5 /drivers/usb/renesas_usbhs
parentcb96632c185f13f746d009ec1125539e0b5cd899 (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.c4
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,
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: