“8be7a962e86ac47b5ee2b339e08cca1e5c063c15”上不存在“arch/arm/git@gitcode.net:openeuler/raspberrypi-kernel.git”
提交 ae411413 编写于 作者: F Fei Yang 提交者: Felipe Balbi

usb: dwc3: ep0: sanity check test mode selector

In case host sends us an unsupported test mode, we
*must* stall this request. This will tell the host
that the selector is invalid and we won't put the
controller in unsupported test modes which could
have undetermined side-effects.
Signed-off-by: NFei Yang <fei.yang@intel.com>
Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
上级 818ec3ab
...@@ -463,8 +463,18 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc, ...@@ -463,8 +463,18 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc,
if (!set) if (!set)
return -EINVAL; return -EINVAL;
dwc->test_mode_nr = wIndex >> 8; switch (wIndex >> 8) {
dwc->test_mode = true; case TEST_J:
case TEST_K:
case TEST_SE0_NAK:
case TEST_PACKET:
case TEST_FORCE_EN:
dwc->test_mode_nr = wIndex >> 8;
dwc->test_mode = true;
break;
default:
return -EINVAL;
}
break; break;
default: default:
return -EINVAL; return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部