mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
USB: garmin_gps: fix memory leak on disconnect
Remove bogus disconnect test introduced by 95bef012e
("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 <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cb25505fc6
commit
618aa1068d
1 changed files with 1 additions and 6 deletions
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue