diff options
author | Johan Hovold <jhovold@gmail.com> | 2012-05-29 12:22:48 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-12 19:09:50 -0400 |
commit | b9c3aab315b51f81649a0d737c4c73783fbd8de0 (patch) | |
tree | c7004c23c1f6127c69eba6e44a21e27f4fa20223 /drivers/usb/serial | |
parent | 4273f9878b0a8271df055e3c8f2e7f08c6a4a2f4 (diff) |
USB: option: fix memory leak
Fix memory leak introduced by commit 383cedc3bb435de7a2 ("USB: serial:
full autosuspend support for the option driver") which allocates
usb-serial data but never frees it.
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/option.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 9c2f7b28e254..d12ee2fca76b 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -47,6 +47,7 @@ | |||
47 | /* Function prototypes */ | 47 | /* Function prototypes */ |
48 | static int option_probe(struct usb_serial *serial, | 48 | static int option_probe(struct usb_serial *serial, |
49 | const struct usb_device_id *id); | 49 | const struct usb_device_id *id); |
50 | static void option_release(struct usb_serial *serial); | ||
50 | static int option_send_setup(struct usb_serial_port *port); | 51 | static int option_send_setup(struct usb_serial_port *port); |
51 | static void option_instat_callback(struct urb *urb); | 52 | static void option_instat_callback(struct urb *urb); |
52 | 53 | ||
@@ -1251,7 +1252,7 @@ static struct usb_serial_driver option_1port_device = { | |||
1251 | .ioctl = usb_wwan_ioctl, | 1252 | .ioctl = usb_wwan_ioctl, |
1252 | .attach = usb_wwan_startup, | 1253 | .attach = usb_wwan_startup, |
1253 | .disconnect = usb_wwan_disconnect, | 1254 | .disconnect = usb_wwan_disconnect, |
1254 | .release = usb_wwan_release, | 1255 | .release = option_release, |
1255 | .read_int_callback = option_instat_callback, | 1256 | .read_int_callback = option_instat_callback, |
1256 | #ifdef CONFIG_PM | 1257 | #ifdef CONFIG_PM |
1257 | .suspend = usb_wwan_suspend, | 1258 | .suspend = usb_wwan_suspend, |
@@ -1333,6 +1334,15 @@ static int option_probe(struct usb_serial *serial, | |||
1333 | return 0; | 1334 | return 0; |
1334 | } | 1335 | } |
1335 | 1336 | ||
1337 | static void option_release(struct usb_serial *serial) | ||
1338 | { | ||
1339 | struct usb_wwan_intf_private *priv = usb_get_serial_data(serial); | ||
1340 | |||
1341 | usb_wwan_release(serial); | ||
1342 | |||
1343 | kfree(priv); | ||
1344 | } | ||
1345 | |||
1336 | static void option_instat_callback(struct urb *urb) | 1346 | static void option_instat_callback(struct urb *urb) |
1337 | { | 1347 | { |
1338 | int err; | 1348 | int err; |