This is a note to let you know that I've just added the patch titled

    USB: cdc-wdm: fix memory leak

to my usb git tree which can be found at
    git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-next branch.

The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)

The patch will also will be merged in the next major kernel release
during the merge window.

If you have any questions about this process, please let me know.


>From 2f338c8a1904e2e7aa5a8bd12fb0cf2422d17da4 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <[email protected]>
Date: Fri, 27 Apr 2012 14:36:37 +0200
Subject: USB: cdc-wdm: fix memory leak

cleanup() is not called if the last close() comes after
disconnect(). That leads to a memory leak. Rectified
by checking for an earlier disconnect() in release()

Signed-off-by: Oliver Neukum <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 drivers/usb/class/cdc-wdm.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index b29a981..650e1da 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -622,6 +622,8 @@ static int wdm_release(struct inode *inode, struct file 
*file)
                kill_urbs(desc);
                if (!test_bit(WDM_DISCONNECTING, &desc->flags))
                        desc->manage_power(desc->intf, 0);
+               else
+                       cleanup(desc);
        }
        mutex_unlock(&wdm_mutex);
        return 0;
-- 
1.7.10


--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to