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>
This commit is contained in:
parent
9e3b1d8e3d
commit
004b4f2d44
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue