Skip to content

Commit

Permalink
usbserial: Reference leak
Browse files Browse the repository at this point in the history
A sufficiently-large number of USB serial devices causes a reference leak
when /proc/tty/drivers/usbserial is read.

Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Matthias Urlichs authored and Greg Kroah-Hartman committed Sep 12, 2006
1 parent 05ff0e2 commit 5992583
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5992583

Please sign in to comment.