diff options
author | Oliver Neukum | 2008-01-22 14:24:56 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2008-02-01 14:35:04 -0800 |
commit | 004b4f2d4448cff7f13871c05d744b00a7c74d4a (patch) | |
tree | dee298674c6620516a60c52c7d4e01495b3fe453 /drivers/usb/serial | |
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/serial')
-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) 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; } |