]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
USB: mos7720: fix port-data memory leak
authorJohan Hovold <jhovold@gmail.com>
Thu, 25 Oct 2012 08:29:05 +0000 (10:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Oct 2012 17:10:16 +0000 (10:10 -0700)
commit89133c6f9cf825de28dff95aa4e933d5349b0101
treedc40d2a50227c17b31cd9fdc55f92bd58d11ecbb
parentbd0758d884d30c79e064db3b7d18cc1ae4899843
USB: mos7720: fix port-data memory leak

commit 4230af572f95b3115bba1ee6fb95681f3851ab26 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 that this patch also fixes a second port-data memory leak in the
error path of attach, should parallel-port initialisation fail.

Compile-only tested.

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