3.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Oliver Neukum <[email protected]>

commit 2f338c8a1904e2e7aa5a8bd12fb0cf2422d17da4 upstream.

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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/usb/class/cdc-wdm.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -625,6 +625,8 @@ static int wdm_release(struct inode *ino
                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;


--
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