mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2026-06-25 11:43:20 +02:00
USB: serial: garmin_gps: fix memory leak on probe errors
commit74d471b598upstream. Make sure to free the port private data before returning after a failed probe attempt. Fixes:1da177e4c3("Linux-2.6.12-rc2") Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
parent
5a41add5d4
commit
c04c343f48
|
|
@ -1476,6 +1476,12 @@ static int garmin_attach(struct usb_serial *serial)
|
|||
usb_set_serial_port_data(port, garmin_data_p);
|
||||
|
||||
status = garmin_init_session(port);
|
||||
if (status)
|
||||
goto err_free;
|
||||
|
||||
return 0;
|
||||
err_free:
|
||||
kfree(garmin_data_p);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user