diff options
author | Oliver Neukum <oliver@neukum.org> | 2008-01-22 08:24:56 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-01 17:35:04 -0500 |
commit | 004b4f2d4448cff7f13871c05d744b00a7c74d4a (patch) | |
tree | dee298674c6620516a60c52c7d4e01495b3fe453 /drivers/usb | |
parent | 9e3b1d8e3d5d135ac7be43f6710b7a67b569c292 (diff) |
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.c | 4 |
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) | |||
151 | return 0; | 151 | return 0; |
152 | 152 | ||
153 | cleanup: | 153 | cleanup: |
154 | for (--i; i >= 0; --i) | 154 | for (--i; i >= 0; --i) { |
155 | kfree(usb_get_serial_port_data(serial->port[i])); | ||
155 | usb_set_serial_port_data(serial->port[i], NULL); | 156 | usb_set_serial_port_data(serial->port[i], NULL); |
157 | } | ||
156 | return -ENOMEM; | 158 | return -ENOMEM; |
157 | } | 159 | } |
158 | 160 | ||