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>
This commit is contained in:
Kuninori Morimoto 2011-04-21 14:10:12 +09:00 коммит произвёл Greg Kroah-Hartman
Родитель cb96632c18
Коммит 9a28b7bd4f
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -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: