Skip to content

Commit 086fd06

Browse files
committed
Revert "usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null"
This reverts commit 1301496. 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 4d27afb commit 086fd06

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
@@ -1421,10 +1421,6 @@ void gserial_disconnect(struct gserial *gser)
14211421
/* REVISIT as above: how best to track this? */
14221422
port->port_line_coding = gser->port_line_coding;
14231423

1424-
/* disable endpoints, aborting down any active I/O */
1425-
usb_ep_disable(gser->out);
1426-
usb_ep_disable(gser->in);
1427-
14281424
port->port_usb = NULL;
14291425
gser->ioport = NULL;
14301426
if (port->port.count > 0) {
@@ -1436,6 +1432,10 @@ void gserial_disconnect(struct gserial *gser)
14361432
spin_unlock(&port->port_lock);
14371433
spin_unlock_irqrestore(&serial_port_lock, flags);
14381434

1435+
/* disable endpoints, aborting down any active I/O */
1436+
usb_ep_disable(gser->out);
1437+
usb_ep_disable(gser->in);
1438+
14391439
/* finally, free any unused/unusable I/O buffers */
14401440
spin_lock_irqsave(&port->port_lock, flags);
14411441
if (port->port.count == 0)

0 commit comments

Comments
 (0)