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>
Sun, 28 Oct 2012 17:56:12 +0000 (10:56 -0700)
commit4147db8f196114198142b181f90d062602528e82
treec179944d6f38ebed525ea084e1556812506a6775
parent18bdc54d39fdbd37c5ca89cc1f48adde43eb33b1
USB: pl2303: fix port-data memory leak

commit 8bf769eb5f6efc33f95088850f33fcc05d28b508 upstream.

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.

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