From: Alexey Khoroshilov Date: Tue, 31 May 2011 20:54:40 +0000 (-0300) Subject: [media] radio-si470x: fix memory leak in si470x_usb_driver_probe() X-Git-Tag: MMI-PSA29.97-13-9~18729^2~406 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f54ba7f199d63cea08b8cc7114cb6c5cd9a042ab;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [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 Signed-off-by: Mauro Carvalho Chehab --- 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, 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: