Details

[Home]

Issue of the Implementation # L0032

Brief

drivers/media/radio/si470x/radio-si470x-usb.c: memory leak in si470x_usb_driver_probe()

Detailed Description

radio->int_in_urb is not deallocated on error paths in si470x_usb_driver_probe().

Possible solutions

--- 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,
        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));
@@ -790,6 +790,8 @@ err_all:
        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:

Component

linux-kernel 2.6.39

Accepted

https://lkml.org/lkml/2011/5/31/483
commit

Status

Fixed in kernel 3.1-rc1

[Home]