upstream: [media] ttusb-budget: fix memory leak in ttusb_probe()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Mon, 10 Jun 2013 19:00:54 +0000 (16:00 -0300)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:48:40 +0000 (11:48 +0900)
If something goes wrong starting from i2c_add_adapter(),
ttusb->iso_urb[] and ttusb itself are not deallocated.
Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c

index 21b9049..f8a60c1 100644 (file)
@@ -1768,6 +1768,8 @@ err_i2c_del_adapter:
        i2c_del_adapter(&ttusb->i2c_adap);
 err_unregister_adapter:
        dvb_unregister_adapter (&ttusb->adapter);
+       ttusb_free_iso_urbs(ttusb);
+       kfree(ttusb);
        return result;
 }