[media] radio-si470x: fix memory leak in si470x_usb_driver_probe()
radio->int_in_urb is not deallocated on error paths in si470x_usb_driver_probe(). 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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
fabc6b85ca
commit
f54ba7f199
@@ -699,7 +699,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
|
|||||||
radio->videodev = video_device_alloc();
|
radio->videodev = video_device_alloc();
|
||||||
if (!radio->videodev) {
|
if (!radio->videodev) {
|
||||||
retval = -ENOMEM;
|
retval = -ENOMEM;
|
||||||
goto err_intbuffer;
|
goto err_urb;
|
||||||
}
|
}
|
||||||
memcpy(radio->videodev, &si470x_viddev_template,
|
memcpy(radio->videodev, &si470x_viddev_template,
|
||||||
sizeof(si470x_viddev_template));
|
sizeof(si470x_viddev_template));
|
||||||
@@ -790,6 +790,8 @@ err_all:
|
|||||||
kfree(radio->buffer);
|
kfree(radio->buffer);
|
||||||
err_video:
|
err_video:
|
||||||
video_device_release(radio->videodev);
|
video_device_release(radio->videodev);
|
||||||
|
err_urb:
|
||||||
|
usb_free_urb(radio->int_in_urb);
|
||||||
err_intbuffer:
|
err_intbuffer:
|
||||||
kfree(radio->int_in_buffer);
|
kfree(radio->int_in_buffer);
|
||||||
err_radio:
|
err_radio:
|
||||||
|
Reference in New Issue
Block a user