diff options
author | Matthias Urlichs <smurf@smurf.noris.de> | 2006-09-11 06:35:20 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-12 06:10:20 -0400 |
commit | 5992583889ce6b7960e8023e356b2a0930ebce7c (patch) | |
tree | 487a1777c3e48dab05c546e15f9f5c9f17a07600 | |
parent | 05ff0e291af086f4325bac76abad250690bbbd63 (diff) |
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 <smurf@smurf.noris.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 12c1694d322e..e06a41bd0f3b 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 | |||
464 | length += sprintf (page+length, " path:%s", tmp); | 464 | length += sprintf (page+length, " path:%s", tmp); |
465 | 465 | ||
466 | length += sprintf (page+length, "\n"); | 466 | length += sprintf (page+length, "\n"); |
467 | if ((length + begin) > (off + count)) | 467 | if ((length + begin) > (off + count)) { |
468 | usb_serial_put(serial); | ||
468 | goto done; | 469 | goto done; |
470 | } | ||
469 | if ((length + begin) < off) { | 471 | if ((length + begin) < off) { |
470 | begin += length; | 472 | begin += length; |
471 | length = 0; | 473 | length = 0; |