提交 b24346a2 编写于 作者: X Xu Yang 提交者: Greg Kroah-Hartman

usb: chipidea: udc: check request status before setting device address

The complete() function may be called even though request is not
completed. In this case, it's necessary to check request status so
as not to set device address wrongly.

Fixes: 10775eb1 ("usb: chipidea: udc: update gadget states according to ch9")
cc: <stable@vger.kernel.org>
Signed-off-by: NXu Yang <xu.yang_2@nxp.com>
Link: https://lore.kernel.org/r/20220623030242.41796-1-xu.yang_2@nxp.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 90bc2af2
......@@ -1048,6 +1048,9 @@ isr_setup_status_complete(struct usb_ep *ep, struct usb_request *req)
struct ci_hdrc *ci = req->context;
unsigned long flags;
if (req->status < 0)
return;
if (ci->setaddr) {
hw_usb_set_address(ci, ci->address);
ci->setaddr = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册