Patchwork [3.5.yuz,extended,stable] Patch "USB: serial: Fix memory leak in sierra_release()" has been added to staging queue

login
register
mail settings
Submitter Herton Ronaldo Krzesinski
Date Nov. 22, 2012, 4:48 a.m.
Message ID <1353559736-2607-1-git-send-email-herton.krzesinski@canonical.com>
Download mbox | patch
Permalink /patch/200987/
State New
Headers show

Comments

Herton Ronaldo Krzesinski - Nov. 22, 2012, 4:48 a.m.
This is a note to let you know that I have just added a patch titled

    USB: serial: Fix memory leak in sierra_release()

to the linux-3.5.y-queue branch of the 3.5.yuz extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.yuz tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Herton

------

From 6f83a98ed5b083b5684d5544b613cc66bc690d60 Mon Sep 17 00:00:00 2001
From: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
Date: Wed, 24 Oct 2012 10:23:09 -0400
Subject: [PATCH] USB: serial: Fix memory leak in sierra_release()

commit f7bc5051667b74c3861f79eed98c60d5c3b883f7 upstream.

I found a memory leak in sierra_release() (well sierra_probe() I guess)
that looses 8 bytes each time the driver releases a device.

Signed-off-by: Len Sorensen <lsorense@csclub.uwaterloo.ca>
Acked-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
---
 drivers/usb/serial/sierra.c |    1 +
 1 file changed, 1 insertion(+)

--
1.7.9.5

Patch

diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index d423d36..7d7ab91 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -964,6 +964,7 @@  static void sierra_release(struct usb_serial *serial)
 			continue;
 		kfree(portdata);
 	}
+	kfree(serial->private);
 }

 #ifdef CONFIG_PM