]> git.baikalelectronics.ru Git - kernel.git/commit
USB: mos7840: fix port-data memory leak
authorJohan Hovold <jhovold@gmail.com>
Thu, 25 Oct 2012 16:56:34 +0000 (18:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Oct 2012 18:11:19 +0000 (11:11 -0700)
commit7cdc016ca9b4de498188f48f763cc27ac78761ac
treeb8bc2072f4df67ad5889b95fc19957b4af466ee0
parent02cbb53578f4df981c99b281a0c3869e4bd4d987
USB: mos7840: 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 bcb6fcf1119586a (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 indentation was kept intact using a do-while(0) in order
to facilitate review. A follow-up patch will remove it.

Compile-only tested.

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