Skip to content

Commit 618aa10

Browse files
jhovoldgregkh
authored andcommitted
USB: garmin_gps: fix memory leak on disconnect
Remove bogus disconnect test introduced by 95bef01 ("USB: more serial drivers writing after disconnect") which prevented queued data from being freed on disconnect. The possible IO it was supposed to prevent is long gone. Cc: stable <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent cb25505 commit 618aa10

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

drivers/usb/serial/garmin_gps.c

+1-6
Original file line numberDiff line numberDiff line change
@@ -956,10 +956,7 @@ static void garmin_close(struct usb_serial_port *port)
956956
if (!serial)
957957
return;
958958

959-
mutex_lock(&port->serial->disc_mutex);
960-
961-
if (!port->serial->disconnected)
962-
garmin_clear(garmin_data_p);
959+
garmin_clear(garmin_data_p);
963960

964961
/* shutdown our urbs */
965962
usb_kill_urb(port->read_urb);
@@ -968,8 +965,6 @@ static void garmin_close(struct usb_serial_port *port)
968965
/* keep reset state so we know that we must start a new session */
969966
if (garmin_data_p->state != STATE_RESET)
970967
garmin_data_p->state = STATE_DISCONNECTED;
971-
972-
mutex_unlock(&port->serial->disc_mutex);
973968
}
974969

975970

0 commit comments

Comments
 (0)