lkml.org 
[lkml]   [2004]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Memory leak in visor.c and ftdi_sio.c
Note that I have not verified any of the below on
hardware associated with drivers/usb/serial/ftdi_sio.c,
only with drivers/usb/serial/visor.c. If anyone has
hardware for this device, I would appreciate your comments.

A memory leak occurs in both drivers/usb/serial/ftdi_sio.c
and drivers/usb/serial/visor.c when the usb device is
unplugged while data is being written to the device. This
patch should clear that up.

This was prepared against 2.6.7-rc2.

Signed-off-by: Joe Nardelli <jnardelli@infosciences.com>


diff -uprN -X dontdiff linux-2.6.7-rc2.orig/drivers/usb/serial/ftdi_sio.c linux-2.6.7-rc2/drivers/usb/serial/ftdi_sio.c
--- linux-2.6.7-rc2.orig/drivers/usb/serial/ftdi_sio.c 2004-06-04 10:10:21.112743024 -0400
+++ linux-2.6.7-rc2/drivers/usb/serial/ftdi_sio.c 2004-06-04 09:53:27.000000000 -0400
@@ -1504,6 +1504,7 @@ static int ftdi_write (struct usb_serial
if (status) {
err("%s - failed submitting write urb, error %d", __FUNCTION__, status);
count = status;
+ kfree (buffer);
}

/* we are done with this urb, so let the host driver
diff -uprN -X dontdiff linux-2.6.7-rc2.orig/drivers/usb/serial/visor.c linux-2.6.7-rc2/drivers/usb/serial/visor.c
--- linux-2.6.7-rc2.orig/drivers/usb/serial/visor.c 2004-06-04 10:10:21.210728128 -0400
+++ linux-2.6.7-rc2/drivers/usb/serial/visor.c 2004-06-04 10:13:10.214035720 -0400
@@ -515,6 +515,7 @@ static int visor_write (struct usb_seria
dev_err(&port->dev, "%s - usb_submit_urb(write bulk) failed with status = %d\n",
__FUNCTION__, status);
count = status;
+ kfree (buffer);
} else {
bytes_out += count;
}
--
Joe Nardelli
jnardelli@infosciences.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.085 / U:0.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site