Skip to contentSkip to conversation

patch "USB: serial: garmin_gps: fix memory leak on failed URB submit" added to usb-linus

PATCH [email protected] 1 participant 1 message Jan 5, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

USB: serial: garmin_gps: fix memory leak on failed URB submit

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

Quoted 1 line

From c4ac4496e835b78a45dfbf74f6173932217e4116 Mon Sep 17 00:00:00 2001

From: Johan Hovold <[email protected]>
Date: Tue, 3 Jan 2017 16:39:41 +0100
Subject: 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 <[email protected]>
---
 drivers/usb/serial/garmin_gps.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/serial/garmin_gps.c +1 -0
index 97cabf803c2f..b2f2e87aed94 100644
@@ -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
Signature · 1 line
2.11.0