mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 22:51:42 +00:00
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>
This commit is contained in:
parent
05ff0e291a
commit
5992583889
@ -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, " path:%s", tmp);
|
||||||
|
|
||||||
length += sprintf (page+length, "\n");
|
length += sprintf (page+length, "\n");
|
||||||
if ((length + begin) > (off + count))
|
if ((length + begin) > (off + count)) {
|
||||||
|
usb_serial_put(serial);
|
||||||
goto done;
|
goto done;
|
||||||
|
}
|
||||||
if ((length + begin) < off) {
|
if ((length + begin) < off) {
|
||||||
begin += length;
|
begin += length;
|
||||||
length = 0;
|
length = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user