USB: pl2303: fix port-data memory leak
authorJohan Hovold <jhovold@gmail.com>
Mon, 15 Oct 2012 13:47:21 +0000 (15:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Oct 2012 17:25:54 +0000 (10:25 -0700)
commit8bf769eb5f6efc33f95088850f33fcc05d28b508
treee108decc83c67db5687765419ea594477b5cd246
parent4295fe7791a1b20c90cbaaa6f23f2fb94218b8a7
USB: pl2303: fix port-data memory leak

Fix port-data memory leak by allocating and freeing port data in
port_probe/remove rather than in attach/release, and by introducing
serial private data to store the device type which is interface rather
than port specific.

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

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/pl2303.c