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] [thread-next>] [day] [month] [year] [list]
Message-ID: <539EEA2A.2040207@ti.com>
Date:	Mon, 16 Jun 2014 07:59:22 -0500
From:	Nishanth Menon <nm@...com>
To:	Axel Lin <axel.lin@...ics.com>, Mark Brown <broonie@...nel.org>
CC:	Aaro Koskinen <aaro.koskinen@....fi>,
	Rajendra Nayak <rnayak@...com>,
	Liam Girdwood <lgirdwood@...il.com>,
	<linux-kernel@...r.kernel.org>,
	linux-omap <linux-omap@...r.kernel.org>
Subject: Re: [PATCH] regulator: twl: Convert to use devm_kmemdup()

+linux-omap.

On 06/15/2014 08:44 PM, Axel Lin wrote:

Might be nice to have a commit message here.

> Signed-off-by: Axel Lin <axel.lin@...ics.com>
> ---
>  drivers/regulator/twl-regulator.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
> index fed28ab..0b4f866 100644
> --- a/drivers/regulator/twl-regulator.c
> +++ b/drivers/regulator/twl-regulator.c
> @@ -1128,7 +1128,7 @@ static int twlreg_probe(struct platform_device *pdev)
>  	if (!initdata)
>  		return -EINVAL;
>  
> -	info = kmemdup(template, sizeof(*info), GFP_KERNEL);
> +	info = devm_kmemdup(&pdev->dev, template, sizeof(*info), GFP_KERNEL);
>  	if (!info)
>  		return -ENOMEM;
>  
> @@ -1192,7 +1192,6 @@ static int twlreg_probe(struct platform_device *pdev)
>  	if (IS_ERR(rdev)) {
>  		dev_err(&pdev->dev, "can't register %s, %ld\n",
>  				info->desc.name, PTR_ERR(rdev));
> -		kfree(info);
>  		return PTR_ERR(rdev);
>  	}
>  	platform_set_drvdata(pdev, rdev);
> @@ -1212,20 +1211,10 @@ static int twlreg_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int twlreg_remove(struct platform_device *pdev)
> -{
> -	struct regulator_dev *rdev = platform_get_drvdata(pdev);
> -	struct twlreg_info *info = rdev->reg_data;
> -
> -	kfree(info);
> -	return 0;
> -}
> -
>  MODULE_ALIAS("platform:twl_reg");
>  
>  static struct platform_driver twlreg_driver = {
>  	.probe		= twlreg_probe,
> -	.remove		= twlreg_remove,
>  	/* NOTE: short name, to work around driver model truncation of
>  	 * "twl_regulator.12" (and friends) to "twl_regulator.1".
>  	 */
> 

otherwise, looks good to me.
Reviewed-by: Nishanth Menon <nm@...com>

-- 
Regards,
Nishanth Menon
--
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