]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
USB: sierra: fix port-data memory leak
authorJohan Hovold <jhovold@gmail.com>
Thu, 25 Oct 2012 08:29:19 +0000 (10:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Oct 2012 17:10:17 +0000 (10:10 -0700)
commit7e4d20169cdd2e9fb458d5d28b515397c112047f
tree06795e86461b23512a5c5d4072718ca14f2db867
parent99ad30180d1a0de0fbe4adfd8d24085ac77e1a24
USB: sierra: fix port-data memory leak

commit f525c05babc7938cc1d4236550fd8a659fb05960 upstream.

Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note also that urb-count for multi-port interfaces has not been changed
even though the usb-serial port number is now determined from the port
and interface minor numbers.

Compile-only tested.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/sierra.c