mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-26 14:43:27 -04:00
staging: gdm7240: fix memory leak on failure path
init_usb() may fail after some of mux_rxes already allocated. So we need to release them on the failure path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a4d8c83cb5
commit
47052577bc
1 changed files with 2 additions and 2 deletions
|
|
@ -541,7 +541,7 @@ static int gdm_mux_probe(struct usb_interface *intf, const struct usb_device_id
|
|||
|
||||
ret = init_usb(mux_dev);
|
||||
if (ret)
|
||||
goto err_free_tty;
|
||||
goto err_free_usb;
|
||||
|
||||
tty_dev->priv_dev = (void *)mux_dev;
|
||||
tty_dev->send_func = gdm_mux_send;
|
||||
|
|
@ -565,8 +565,8 @@ static int gdm_mux_probe(struct usb_interface *intf, const struct usb_device_id
|
|||
|
||||
err_unregister_tty:
|
||||
unregister_lte_tty_device(tty_dev);
|
||||
err_free_usb:
|
||||
release_usb(mux_dev);
|
||||
err_free_tty:
|
||||
kfree(tty_dev);
|
||||
err_free_mux:
|
||||
kfree(mux_dev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue