Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1568248 > unrolled thread

[PATCH 3.12 096/235] USB: serial: garmin_gps: fix memory leak on failed URB submit

Started byJiri Slaby <jslaby@suse.cz>
First post2017-01-27 12:50 +0100
Last post2017-01-27 12:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.12 096/235] USB: serial: garmin_gps: fix memory leak on failed URB submit Jiri Slaby <jslaby@suse.cz> - 2017-01-27 12:50 +0100

#1568248 — [PATCH 3.12 096/235] USB: serial: garmin_gps: fix memory leak on failed URB submit

FromJiri Slaby <jslaby@suse.cz>
Date2017-01-27 12:50 +0100
Subject[PATCH 3.12 096/235] USB: serial: garmin_gps: fix memory leak on failed URB submit
Message-ID<t4dcv-3zE-45@gated-at.bofh.it>
From: Johan Hovold <johan@kernel.org>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

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: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/serial/garmin_gps.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c
index 04b5ed90ffb2..9f1381dfce8c 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
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web