From: Matthias Urlichs Date: Mon, 11 Sep 2006 10:35:20 +0000 (+0200) Subject: usbserial: Reference leak X-Git-Tag: v2.6.18-rc7~4^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5992583889ce6b7960e8023e356b2a0930ebce7c;p=linux-2.6 usbserial: Reference leak A sufficiently-large number of USB serial devices causes a reference leak when /proc/tty/drivers/usbserial is read. Signed-Off-By: Matthias Urlichs Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 12c1694d32..e06a41bd0f 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -464,8 +464,10 @@ static int serial_read_proc (char *page, char **start, off_t off, int count, int 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;