diff options
| author | Johan Hovold <johan@kernel.org> | 2017-01-03 16:39:41 +0100 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2017-06-17 15:48:16 +0200 |
| commit | 181a4033bb65a3b0479dd398962390b769359d47 (patch) | |
| tree | 1d50e4f75b79df87d2cb350a3b9ed0028eef64c1 /drivers | |
| parent | 229744024e8bfaeba867b5fad82e4ca47ba708ae (diff) | |
USB: serial: garmin_gps: fix memory leak on failed URB submit
commit c4ac4496e835b78a45dfbf74f6173932217e4116 upstream.
Make sure to free the URB transfer buffer in case submission fails (e.g.
due to a disconnect).
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/usb/serial/garmin_gps.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c index b110c573e..ea9c4f4ae 100644 --- a/drivers/usb/serial/garmin_gps.c +++ b/drivers/usb/serial/garmin_gps.c @@ -1049,6 +1049,7 @@ static int garmin_write_bulk(struct usb_serial_port *port, "%s - usb_submit_urb(write bulk) failed with status = %d\n", __func__, status); count = status; + kfree(buffer); } /* we are done with this urb, so let the host driver |
