Skip to content

Commit b24346a

Browse files
Xu Yanggregkh
authored andcommitted
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: 10775eb ("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>
1 parent 90bc2af commit b24346a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • drivers/usb/chipidea

drivers/usb/chipidea/udc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,9 @@ isr_setup_status_complete(struct usb_ep *ep, struct usb_request *req)
10481048
struct ci_hdrc *ci = req->context;
10491049
unsigned long flags;
10501050

1051+
if (req->status < 0)
1052+
return;
1053+
10511054
if (ci->setaddr) {
10521055
hw_usb_set_address(ci, ci->address);
10531056
ci->setaddr = false;

0 commit comments

Comments
 (0)