]> git.baikalelectronics.ru Git - kernel.git/commit
USB: metro-usb: fix port-data memory leak
authorJohan Hovold <jhovold@gmail.com>
Thu, 25 Oct 2012 08:28:59 +0000 (10:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Oct 2012 16:36:57 +0000 (09:36 -0700)
commit7f73464b2cf43cc2426cfd4195e7ec5675ee51d3
tree6353829484f34cc1269d55e57ab32eb002ead831
parente206a6db7782f5e7a98bfde31796b9f855e51c66
USB: metro-usb: fix port-data memory leak

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

Since commit c3e213df083439e (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 that the call to metrousb_clean (close) in shutdown was redundant.

Compile-only tested.

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