You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
usb: chipidea: udc: check request status before setting device address
commitb24346a240upstream. 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:10775eb17b("usb: chipidea: udc: update gadget states according to ch9") cc: <stable@vger.kernel.org> Signed-off-by: Xu Yang <xu.yang_2@nxp.com> Link: https://lore.kernel.org/r/20220623030242.41796-1-xu.yang_2@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
656eca37aa
commit
2d7bdb6a5a
@@ -1034,6 +1034,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;
|
||||
|
||||
Reference in New Issue
Block a user