usb: dwc3: gadget: conditionally remove requests
authorMichael Grzeschik <m.grzeschik@pengutronix.de>
Wed, 20 Jul 2022 21:35:23 +0000 (23:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:41:09 +0000 (17:41 +0100)
commit765ca3e63f3771649ac59e90d68d04298a42ef35
tree753b4e42feadebf5e8607c938ab27618999fc306
parent7945cbf8666a8ed4a31581c39e49ef583521b7f5
usb: dwc3: gadget: conditionally remove requests

[ Upstream commit b44c0e7fef51ee7e8ca8c6efbf706f5613787100 ]

The functions stop_active_transfers and ep_disable are both calling
remove_requests. This functions in both cases will giveback the requests
with status ESHUTDOWN, which also represents an physical disconnection.
For ep_disable this is not true. This patch adds the status parameter to
remove_requests and sets the status to ECONNRESET on ep_disable.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20220720213523.1055897-1-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: f90f5afd5083 ("usb: dwc3: gadget: Clear ep descriptor last")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/dwc3/gadget.c