From patchwork Thu Apr 7 19:23:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Juhl X-Patchwork-Id: 693381 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 p388EDrK003611 for ; Fri, 8 Apr 2011 08:14:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756664Ab1DGTXc (ORCPT ); Thu, 7 Apr 2011 15:23:32 -0400 Received: from swampdragon.chaosbits.net ([90.184.90.115]:13251 "EHLO swampdragon.chaosbits.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756714Ab1DGTXb (ORCPT ); Thu, 7 Apr 2011 15:23:31 -0400 Received: by swampdragon.chaosbits.net (Postfix, from userid 1000) id 4082D9403D; Thu, 7 Apr 2011 21:23:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by swampdragon.chaosbits.net (Postfix) with ESMTP id 3DE259403B; Thu, 7 Apr 2011 21:23:48 +0200 (CEST) Date: Thu, 7 Apr 2011 21:23:48 +0200 (CEST) From: Jesper Juhl To: Mauro Carvalho Chehab cc: Andy Walls , linux-media@vger.kernel.org, Alexey Chernov <4ernov@gmail.com>, linux-kernel@vger.kernel.org, Laurent Pinchart , "Igor M. Liplianin" , Steven Toth Subject: [PATCH][media] cx23885: Don't leak firmware in cx23885_card_setup() Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 08 Apr 2011 08:14:20 +0000 (UTC) We leak the memory allocated to 'fw' (the firmware) when the variable goes out of scope. Fix the leak by calling release_firmware(fw) before 'fw' goes out of scope. Signed-off-by: Jesper Juhl --- cx23885-cards.c | 1 + 1 file changed, 1 insertion(+) compile tested only. diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c index ea88722..2354336 100644 --- a/drivers/media/video/cx23885/cx23885-cards.c +++ b/drivers/media/video/cx23885/cx23885-cards.c @@ -1399,6 +1399,7 @@ void cx23885_card_setup(struct cx23885_dev *dev) else altera_init(&netup_config, fw); + release_firmware(fw); break; } }