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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 06 Aug 2012 10:20:50 +0900
From:	Jingoo Han <jg1.han@...sung.com>
To:	'Julia Lawall' <Julia.Lawall@...6.fr>,
	'Richard Purdie' <rpurdie@...ys.net>
Cc:	kernel-janitors@...r.kernel.org,
	'Florian Tobias Schandinat' <FlorianSchandinat@....de>,
	linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	'Jingoo Han' <jg1.han@...sung.com>
Subject: Re: [PATCH 5/6] drivers/video/backlight/da9052_bl.c: drop devm_kfree
 of devm_kzalloc'd data

On Sunday, August 05, 2012 1:51 AM Julia Lawall wrote:
> 
> From: Julia Lawall <Julia.Lawall@...6.fr>
> 
> devm_kfree should not have to be explicitly used.
> 
> The semantic patch that fixes this problem is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> expression x,d;
> @@
> 
> x = devm_kzalloc(...)
> ...
> ?-devm_kfree(d,x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@...6.fr>


Acked-by: Jingoo Han <jg1.han@...sung.com>

It looks good.

Best regard,
Jingoo Han


> 
> ---
>  drivers/video/backlight/da9052_bl.c |    2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/video/backlight/da9052_bl.c b/drivers/video/backlight/da9052_bl.c
> index b628d68..7c8626a 100644
> --- a/drivers/video/backlight/da9052_bl.c
> +++ b/drivers/video/backlight/da9052_bl.c
> @@ -129,7 +129,6 @@ static int da9052_backlight_probe(struct platform_device *pdev)
>  				       &da9052_backlight_ops, &props);
>  	if (IS_ERR(bl)) {
>  		dev_err(&pdev->dev, "Failed to register backlight\n");
> -		devm_kfree(&pdev->dev, wleds);
>  		return PTR_ERR(bl);
>  	}
> 
> @@ -149,7 +148,6 @@ static int da9052_backlight_remove(struct platform_device *pdev)
>  	wleds->state = DA9052_WLEDS_OFF;
>  	da9052_adjust_wled_brightness(wleds);
>  	backlight_device_unregister(bl);
> -	devm_kfree(&pdev->dev, wleds);
> 
>  	return 0;
>  }
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
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