usb: dwc3: gadget: Avoid continuing preparing TRBs during teardown
authorWesley Cheng <wcheng@codeaurora.org>
Fri, 19 Mar 2021 09:31:24 +0000 (02:31 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Mar 2021 12:01:11 +0000 (13:01 +0100)
commit02fa4b980245087a04ea34ae7541ebdc56a5daa4
tree0b3dccb3c7393032b1da172af1c009aebb28285e
parent5e7121723d5b8280c9f37e04d9b5c20beae33c12
usb: dwc3: gadget: Avoid continuing preparing TRBs during teardown

Add checks similar to dwc3_gadget_ep_queue() before kicking off
transfers after getting an endpoint completion event.   Since cleaning
up completed requests will momentarily unlock dwc->lock, there is a
chance for a sequence like pullup disable to be executed.  This can
lead to preparing a TRB, which will be removed by the pullup disable
routine.

Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Link: https://lore.kernel.org/r/1616146285-19149-2-git-send-email-wcheng@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/gadget.c