mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
usb: gadget: f_tcm: Stop proceeding further on -ESHUTDOWN
If the error code is -ESHUTDOWN, stop processing the request/command further and prepare for teardown. -ESHUTDOWN is for device reset or disconnection. Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Link: https://lore.kernel.org/r/b14410cce6bc7b8a0b43da23a8e0cf1ed1fa8ab6.1733876548.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
89e4ec503d
commit
2d6d0c695e
1 changed files with 7 additions and 3 deletions
|
|
@ -62,10 +62,11 @@ static void bot_status_complete(struct usb_ep *ep, struct usb_request *req)
|
|||
struct f_uas *fu = cmd->fu;
|
||||
|
||||
transport_generic_free_cmd(&cmd->se_cmd, 0);
|
||||
if (req->status < 0) {
|
||||
pr_err("ERR %s(%d)\n", __func__, __LINE__);
|
||||
if (req->status == -ESHUTDOWN)
|
||||
return;
|
||||
}
|
||||
|
||||
if (req->status < 0)
|
||||
pr_err("ERR %s(%d)\n", __func__, __LINE__);
|
||||
|
||||
/* CSW completed, wait for next CBW */
|
||||
bot_enqueue_cmd_cbw(fu);
|
||||
|
|
@ -276,6 +277,9 @@ static void bot_cmd_complete(struct usb_ep *ep, struct usb_request *req)
|
|||
struct f_uas *fu = req->context;
|
||||
int ret;
|
||||
|
||||
if (req->status == -ESHUTDOWN)
|
||||
return;
|
||||
|
||||
fu->flags &= ~USBG_BOT_CMD_PEND;
|
||||
|
||||
if (req->status < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue