aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-01-03 10:39:41 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-12 05:39:14 -0500
commit0556702bf34e6c464b7ca0e14f66a87e8959aea0 (patch)
treeb1dae47321929e44679f88812b8d5d4a0adc0e86 /drivers/usb/serial
parent9401cc62b7f5acbb65d689e4da2b1b00c85861c3 (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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial')
-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 97cabf803c2f..b2f2e87aed94 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,
1043 "%s - usb_submit_urb(write bulk) failed with status = %d\n", 1043 "%s - usb_submit_urb(write bulk) failed with status = %d\n",
1044 __func__, status); 1044 __func__, status);
1045 count = status; 1045 count = status;
1046 kfree(buffer);
1046 } 1047 }
1047 1048
1048 /* we are done with this urb, so let the host driver 1049 /* we are done with this urb, so let the host driver