From patchwork Wed Sep 16 11:13:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janne Grunau X-Patchwork-Id: 47948 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8GBCmCc021460 for ; Wed, 16 Sep 2009 11:12:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754001AbZIPLMn (ORCPT ); Wed, 16 Sep 2009 07:12:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752252AbZIPLMn (ORCPT ); Wed, 16 Sep 2009 07:12:43 -0400 Received: from tichy.grunau.be ([85.131.189.73]:57108 "EHLO tichy.grunau.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850AbZIPLMn (ORCPT ); Wed, 16 Sep 2009 07:12:43 -0400 Received: from localhost (unknown [78.52.192.90]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tichy.grunau.be (Postfix) with ESMTPSA id 00AA1908D6; Wed, 16 Sep 2009 13:12:46 +0200 (CEST) Date: Wed, 16 Sep 2009 13:13:26 +0200 From: Janne Grunau To: Julia Lawall Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH 3/8] drivers/media/video/hdpvr: introduce missing kfree Message-ID: <20090916111325.GA14900@aniel.lan> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Fri, Sep 11, 2009 at 06:21:35PM +0200, Julia Lawall wrote: > > Error handling code following a kzalloc should free the allocated data. Thanks for the report. I'll commit a different patch which adds the buffer to the buffer list as soon it is allocated. The hdpvr_free_buffers() in the error handling code will clean it up then. See below: --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/linux/drivers/media/video/hdpvr/hdpvr-video.c b/linux/drivers/media/video/hdpvr/hdpvr-video.c --- a/linux/drivers/media/video/hdpvr/hdpvr-video.c +++ b/linux/drivers/media/video/hdpvr/hdpvr-video.c @@ -134,6 +134,8 @@ v4l2_err(&dev->v4l2_dev, "cannot allocate buffer\n"); goto exit; } + list_add_tail(&buf->buff_list, &dev->free_buff_list); + buf->dev = dev; urb = usb_alloc_urb(0, GFP_KERNEL); @@ -158,7 +160,6 @@ hdpvr_read_bulk_callback, buf); buf->status = BUFSTAT_AVAILABLE; - list_add_tail(&buf->buff_list, &dev->free_buff_list); } return 0; exit: