提交 9a28b7bd 编写于 作者: K Kuninori Morimoto 提交者: Greg Kroah-Hartman

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: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 cb96632c
...@@ -583,6 +583,10 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv, ...@@ -583,6 +583,10 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv,
char *msg; char *msg;
uep = usbhsg_gpriv_to_nth_uep(gpriv, nth); 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) { switch (recip) {
case USB_RECIP_DEVICE: case USB_RECIP_DEVICE:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册