summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2008-01-22 14:24:56 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2008-02-01 23:35:04 +0100
commit004b4f2d4448cff7f13871c05d744b00a7c74d4a (patch)
treedee298674c6620516a60c52c7d4e01495b3fe453 /drivers/usb
parentUSB: stop abuse of intfdata in cypress_m8 (diff)
downloadlinux-004b4f2d4448cff7f13871c05d744b00a7c74d4a.tar.xz
linux-004b4f2d4448cff7f13871c05d744b00a7c74d4a.zip
USB: fix memleak in ark3116 serial driver
in an error case memory already allocated must be freed again. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/ark3116.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index ddfee918000d..fe2bfd67ba8e 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -151,8 +151,10 @@ static int ark3116_attach(struct usb_serial *serial)
return 0;
cleanup:
- for (--i; i >= 0; --i)
+ for (--i; i >= 0; --i) {
+ kfree(usb_get_serial_port_data(serial->port[i]));
usb_set_serial_port_data(serial->port[i], NULL);
+ }
return -ENOMEM;
}