lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5036959F.4010506@gmx.de>
Date:	Thu, 23 Aug 2012 20:42:07 +0000
From:	Florian Tobias Schandinat <FlorianSchandinat@....de>
To:	Damien Cassou <damien.cassou@...l.fr>
CC:	David Brown <davidb@...eaurora.org>,
	kernel-janitors@...r.kernel.org,
	Daniel Walker <dwalker@...o99.com>,
	Bryan Huntsman <bryanh@...eaurora.org>,
	linux-arm-msm@...r.kernel.org, linux-fbdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/5] drivers/video/msm/mddi_client_nt35399.c: use devm_
 functions

On 08/03/2012 03:40 PM, Damien Cassou wrote:
> From: Damien Cassou <damien.cassou@...l.fr>
> 
> 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 <damien.cassou@...l.fr>

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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ