From patchwork Tue May 31 20:54:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Khoroshilov X-Patchwork-Id: 833982 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4VLJR9Y027460 for ; Tue, 31 May 2011 21:19:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932621Ab1EaVTI (ORCPT ); Tue, 31 May 2011 17:19:08 -0400 Received: from smtp.ispras.ru ([83.149.198.202]:43423 "EHLO smtp.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932601Ab1EaVTH (ORCPT ); Tue, 31 May 2011 17:19:07 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 31 May 2011 21:19:28 +0000 (UTC) X-Greylist: delayed 1408 seconds by postgrey-1.27 at vger.kernel.org; Tue, 31 May 2011 17:19:07 EDT Received: from hednb.ispras.ru (winnie.ispras.ru [83.149.198.236]) by smtp.ispras.ru (Postfix) with ESMTP id AAB415D4109; Wed, 1 Jun 2011 00:51:18 +0400 (MSD) From: Alexey Khoroshilov To: Mauro Carvalho Chehab Cc: Alexey Khoroshilov , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] V4L/DVB: radio-si470x: fix memory leak in si470x_usb_driver_probe() Date: Wed, 1 Jun 2011 00:54:40 +0400 Message-Id: <1306875280-9949-1-git-send-email-khoroshilov@ispras.ru> X-Mailer: git-send-email 1.7.4.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 --- drivers/media/radio/si470x/radio-si470x-usb.c | 4 +++- 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 392e84f..ccefdae 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: