summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-01-03 16:39:41 +0100
committerJohan Hovold <johan@kernel.org>2017-01-04 10:37:15 +0100
commitc4ac4496e835b78a45dfbf74f6173932217e4116 (patch)
treeb7f2f0e6c86dd3c39f095f11c36d8f503cdbef6f /drivers/usb
parent3dca01114dcecb1cf324534cd8d75fd1306a516b (diff)
downloadop-kernel-dev-c4ac4496e835b78a45dfbf74f6173932217e4116.zip
op-kernel-dev-c4ac4496e835b78a45dfbf74f6173932217e4116.tar.gz
USB: serial: garmin_gps: fix memory leak on failed URB submit
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") Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/garmin_gps.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c
index 97cabf8..b2f2e87 100644
--- a/drivers/usb/serial/garmin_gps.c
+++ b/drivers/usb/serial/garmin_gps.c
@@ -1043,6 +1043,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
OpenPOWER on IntegriCloud