This is a note to let you know that I've just added the patch titled
usb: Fix qcserial memory leak on rmmod
to the 2.6.38-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
usb-fix-qcserial-memory-leak-on-rmmod.patch
and it can be found in the queue-2.6.38 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From 10c9ab15d6aee153968d150c05b3ee3df89673de Mon Sep 17 00:00:00 2001
From: Steven Hardy <[email protected]>
Date: Mon, 4 Apr 2011 17:57:37 +0100
Subject: usb: Fix qcserial memory leak on rmmod
From: Steven Hardy <[email protected]>
commit 10c9ab15d6aee153968d150c05b3ee3df89673de upstream.
qcprobe function allocates serial->private but this is never freed, this
patch adds a new function qc_release() which frees serial->private, after
calling usb_wwan_release
Signed-off-by: Steven Hardy <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/usb/serial/qcserial.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -205,6 +205,18 @@ static int qcprobe(struct usb_serial *se
return retval;
}
+static void qc_release(struct usb_serial *serial)
+{
+ struct usb_wwan_intf_private *priv = usb_get_serial_data(serial);
+
+ dbg("%s", __func__);
+
+ /* Call usb_wwan release & free the private data allocated in qcprobe */
+ usb_wwan_release(serial);
+ usb_set_serial_data(serial, NULL);
+ kfree(priv);
+}
+
static struct usb_serial_driver qcdevice = {
.driver = {
.owner = THIS_MODULE,
@@ -222,7 +234,7 @@ static struct usb_serial_driver qcdevice
.chars_in_buffer = usb_wwan_chars_in_buffer,
.attach = usb_wwan_startup,
.disconnect = usb_wwan_disconnect,
- .release = usb_wwan_release,
+ .release = qc_release,
#ifdef CONFIG_PM
.suspend = usb_wwan_suspend,
.resume = usb_wwan_resume,
Patches currently in stable-queue which might be from [email protected] are
queue-2.6.38/usb-qcserial-avoid-pointing-to-freed-memory.patch
queue-2.6.38/usb-fix-qcserial-memory-leak-on-rmmod.patch
queue-2.6.38/usb-qcserial-add-missing-errorpath-kfrees.patch
_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable