Skip to content

Commit

Permalink
USB: garmin_gps: fix memory leak on disconnect
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jhovold authored and gregkh committed Mar 21, 2013
1 parent cb25505 commit 618aa10
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/usb/serial/garmin_gps.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,10 +956,7 @@ static void garmin_close(struct usb_serial_port *port)
if (!serial)
return;

mutex_lock(&port->serial->disc_mutex);

if (!port->serial->disconnected)
garmin_clear(garmin_data_p);
garmin_clear(garmin_data_p);

/* shutdown our urbs */
usb_kill_urb(port->read_urb);
Expand All @@ -968,8 +965,6 @@ static void garmin_close(struct usb_serial_port *port)
/* keep reset state so we know that we must start a new session */
if (garmin_data_p->state != STATE_RESET)
garmin_data_p->state = STATE_DISCONNECTED;

mutex_unlock(&port->serial->disc_mutex);
}


Expand Down

0 comments on commit 618aa10

Please sign in to comment.