Commit 4d45e218 authored by matthieu castet's avatar matthieu castet Committed by Greg Kroah-Hartman

[PATCH] USB: UEAGLE : memory leack fix

this patch fix leak of memory allocated to intr if allocation of
sc->urb_int fails.
Found by the Coverity checker.
Signed-off-by: default avatarDuncan Sands <baldrick@free.fr>
Signed-off-by: default avatarMatthieu CASTET <castet.matthieu@free.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 584958c3
...@@ -1376,7 +1376,7 @@ static int uea_boot(struct uea_softc *sc) ...@@ -1376,7 +1376,7 @@ static int uea_boot(struct uea_softc *sc)
if (ret < 0) { if (ret < 0) {
uea_err(INS_TO_USBDEV(sc), uea_err(INS_TO_USBDEV(sc),
"urb submition failed with error %d\n", ret); "urb submition failed with error %d\n", ret);
goto err1; goto err;
} }
sc->kthread = kthread_run(uea_kthread, sc, "ueagle-atm"); sc->kthread = kthread_run(uea_kthread, sc, "ueagle-atm");
...@@ -1390,10 +1390,10 @@ static int uea_boot(struct uea_softc *sc) ...@@ -1390,10 +1390,10 @@ static int uea_boot(struct uea_softc *sc)
err2: err2:
usb_kill_urb(sc->urb_int); usb_kill_urb(sc->urb_int);
err1:
kfree(intr);
err: err:
usb_free_urb(sc->urb_int); usb_free_urb(sc->urb_int);
sc->urb_int = NULL;
kfree(intr);
uea_leaves(INS_TO_USBDEV(sc)); uea_leaves(INS_TO_USBDEV(sc));
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment