aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2011-05-31 16:54:40 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:52:21 -0400
commitf54ba7f199d63cea08b8cc7114cb6c5cd9a042ab (patch)
treef5d1c3c216ceb216613634eebe8f1b4d93c9ee69 /drivers/media/radio
parentfabc6b85ca1d364f4e3fdcf80f80b393a508e771 (diff)
[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>
Diffstat (limited to 'drivers/media/radio')
-rw-r--r--drivers/media/radio/si470x/radio-si470x-usb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c
index 392e84fe90ef..ccefdaea4dc5 100644
--- a/drivers/media/radio/si470x/radio-si470x-usb.c
+++ b/drivers/media/radio/si470x/radio-si470x-usb.c
@@ -699,7 +699,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
699 radio->videodev = video_device_alloc(); 699 radio->videodev = video_device_alloc();
700 if (!radio->videodev) { 700 if (!radio->videodev) {
701 retval = -ENOMEM; 701 retval = -ENOMEM;
702 goto err_intbuffer; 702 goto err_urb;
703 } 703 }
704 memcpy(radio->videodev, &si470x_viddev_template, 704 memcpy(radio->videodev, &si470x_viddev_template,
705 sizeof(si470x_viddev_template)); 705 sizeof(si470x_viddev_template));
@@ -790,6 +790,8 @@ err_all:
790 kfree(radio->buffer); 790 kfree(radio->buffer);
791err_video: 791err_video:
792 video_device_release(radio->videodev); 792 video_device_release(radio->videodev);
793err_urb:
794 usb_free_urb(radio->int_in_urb);
793err_intbuffer: 795err_intbuffer:
794 kfree(radio->int_in_buffer); 796 kfree(radio->int_in_buffer);
795err_radio: 797err_radio: