Skip to content

Commit

Permalink
[media] radio-si470x: fix memory leak in si470x_usb_driver_probe()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexey Khoroshilov authored and Mauro Carvalho Chehab committed Jul 27, 2011
1 parent fabc6b8 commit f54ba7f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/radio/si470x/radio-si470x-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
radio->videodev = video_device_alloc();
if (!radio->videodev) {
retval = -ENOMEM;
goto err_intbuffer;
goto err_urb;
}
memcpy(radio->videodev, &si470x_viddev_template,
sizeof(si470x_viddev_template));
Expand Down Expand Up @@ -790,6 +790,8 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
kfree(radio->buffer);
err_video:
video_device_release(radio->videodev);
err_urb:
usb_free_urb(radio->int_in_urb);
err_intbuffer:
kfree(radio->int_in_buffer);
err_radio:
Expand Down

0 comments on commit f54ba7f

Please sign in to comment.