Skip to contentSkip to conversation

usbserial: Reference leak

PATCH New Matthias Urlichs 1 participant 1 message Sep 11, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usbserial: Reference leak

A sufficiently-large number of USB serial devices causes a reference leak when /proc/tty/drivers/usbserial is read.

---
This should be in 2.6.18, for obvious reasons.
It also applies to older 2.6 kernels.)
---

drivers/usb/serial/usb-serial.c +3 -1
index 3e96350..fae1410 100644
@@ -471,8 +471,10 @@ static int serial_read_proc (char *page,
 		length += sprintf (page+length, " path:%s", tmp);
 			
 		length += sprintf (page+length, "\n");
-		if ((length + begin) > (off + count))
+		if ((length + begin) > (off + count)) {
+			usb_serial_put(serial);
 			goto done;
+		}
 		if ((length + begin) < off) {
 			begin += length;
 			length = 0;
Signature · 1 line
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  [email protected]