Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934344Ab2HWUmR (ORCPT ); Thu, 23 Aug 2012 16:42:17 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:48985 "HELO mailout-de.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S932284Ab2HWUmN (ORCPT ); Thu, 23 Aug 2012 16:42:13 -0400 X-Authenticated: #10250065 X-Provags-ID: V01U2FsdGVkX18WpH1+HqgWBGWP7qdSoCcpPPtaaThJef5/829QgM QdVOn1jeJj2npf Message-ID: <5036959F.4010506@gmx.de> Date: Thu, 23 Aug 2012 20:42:07 +0000 From: Florian Tobias Schandinat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20120613 Icedove/3.0.11 MIME-Version: 1.0 To: Damien Cassou CC: David Brown , kernel-janitors@vger.kernel.org, Daniel Walker , Bryan Huntsman , linux-arm-msm@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/5] drivers/video/msm/mddi_client_nt35399.c: use devm_ functions References: <1344008414-2894-1-git-send-email-damien.cassou@lifl.fr> <1344008414-2894-5-git-send-email-damien.cassou@lifl.fr> In-Reply-To: <1344008414-2894-5-git-send-email-damien.cassou@lifl.fr> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1663 Lines: 53 On 08/03/2012 03:40 PM, Damien Cassou wrote: > From: Damien Cassou > > The various devm_ functions allocate memory that is released when a driver > detaches. This patch replaces the use of kzalloc by devm_kzalloc. > > Additionally, this patch fixes a memory leak: some memory was allocated for > 'panel' but not released when the subsequent call to setup_vsync fails. > > Signed-off-by: Damien Cassou Applied. Thanks, Florian Tobias Schandinat > > --- > drivers/video/msm/mddi_client_nt35399.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/video/msm/mddi_client_nt35399.c b/drivers/video/msm/mddi_client_nt35399.c > index 7fcd67e..66b314e 100644 > --- a/drivers/video/msm/mddi_client_nt35399.c > +++ b/drivers/video/msm/mddi_client_nt35399.c > @@ -189,8 +189,9 @@ static int mddi_nt35399_probe(struct platform_device *pdev) > > int ret; > > - struct panel_info *panel = kzalloc(sizeof(struct panel_info), > - GFP_KERNEL); > + struct panel_info *panel = devm_kzalloc(&pdev->dev, > + sizeof(struct panel_info), > + GFP_KERNEL); > > printk(KERN_DEBUG "%s: enter.\n", __func__); > > @@ -233,7 +234,6 @@ static int mddi_nt35399_remove(struct platform_device *pdev) > struct panel_info *panel = platform_get_drvdata(pdev); > > setup_vsync(panel, 0); > - kfree(panel); > return 0; > } > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/