Skip to content

Commit 33233b0

Browse files
committed
Revert "usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null"
commit 086fd062bc3883ae1ce4166cff5355db315ad879 upstream. This reverts commit 13014969cbf07f18d62ceea40bd8ca8ec9d36cec. It is reported to cause crashes on Tegra systems, so revert it for now. Link: https://lore.kernel.org/r/[email protected] Reported-by: Jon Hunter <[email protected]> Cc: stable <[email protected]> Cc: Lianqin Hu <[email protected]> Link: https://lore.kernel.org/r/2025011711-yippee-fever-a737@gregkh Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4b9b41f commit 33233b0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/usb/gadget/function/u_serial.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,10 +1393,6 @@ void gserial_disconnect(struct gserial *gser)
13931393
/* REVISIT as above: how best to track this? */
13941394
port->port_line_coding = gser->port_line_coding;
13951395

1396-
/* disable endpoints, aborting down any active I/O */
1397-
usb_ep_disable(gser->out);
1398-
usb_ep_disable(gser->in);
1399-
14001396
port->port_usb = NULL;
14011397
gser->ioport = NULL;
14021398
if (port->port.count > 0) {
@@ -1408,6 +1404,10 @@ void gserial_disconnect(struct gserial *gser)
14081404
spin_unlock(&port->port_lock);
14091405
spin_unlock_irqrestore(&serial_port_lock, flags);
14101406

1407+
/* disable endpoints, aborting down any active I/O */
1408+
usb_ep_disable(gser->out);
1409+
usb_ep_disable(gser->in);
1410+
14111411
/* finally, free any unused/unusable I/O buffers */
14121412
spin_lock_irqsave(&port->port_lock, flags);
14131413
if (port->port.count == 0)

0 commit comments

Comments
 (0)