Skip to content

Commit 1f97e3f

Browse files
xairygregkh
authored andcommitted
usb: raw-gadget: don't disable device if usb_ep_queue fails
During device operation, the host might decide to reset a device emulated via Raw Gadget. In this case, if the device emulation code has endpoint requests queued, usb_ep_queue will fail with -ESHUTDOWN. Currently, this disables the Raw Gadget device and makes the emulation code unable to proceed. Do not disable the Raw Gadget device if usb_ep_queue fails. Signed-off-by: Andrey Konovalov <andreyknvl@gmail.com> Link: https://lore.kernel.org/r/3c5df3dddb67623b4aeb11c5546370363e65d8e2.1698350424.git.andreyknvl@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e8033bd commit 1f97e3f

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

drivers/usb/gadget/legacy/raw_gadget.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,6 @@ static int raw_process_ep0_io(struct raw_dev *dev, struct usb_raw_ep_io *io,
693693
dev_err(&dev->gadget->dev,
694694
"fail, usb_ep_queue returned %d\n", ret);
695695
spin_lock_irqsave(&dev->lock, flags);
696-
dev->state = STATE_DEV_FAILED;
697696
goto out_queue_failed;
698697
}
699698

@@ -1080,7 +1079,6 @@ static int raw_process_ep_io(struct raw_dev *dev, struct usb_raw_ep_io *io,
10801079
dev_err(&dev->gadget->dev,
10811080
"fail, usb_ep_queue returned %d\n", ret);
10821081
spin_lock_irqsave(&dev->lock, flags);
1083-
dev->state = STATE_DEV_FAILED;
10841082
goto out_queue_failed;
10851083
}
10861084

0 commit comments

Comments
 (0)