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]
Date:	Thu, 26 Sep 2013 16:11:59 +0900
From:	Jingoo Han <jg1.han@...sung.com>
To:	'Mark Brown' <broonie@...nel.org>,
	'Sachin Kamat' <sachin.kamat@...aro.org>
Cc:	'Liam Girdwood' <lgirdwood@...il.com>,
	linux-kernel@...r.kernel.org, 'Balaji T K' <balajitk@...com>,
	'Nishanth Menon' <nm@...com>,
	'Jingoo Han' <jg1.han@...sung.com>
Subject: Re: [PATCH V2 17/18] regulator: twl: use devm_regulator_register()

On Thursday, September 26, 2013 11:13 AM, Jingoo Han wrote:
> 
> Use devm_regulator_register() to make cleanup paths simpler.
> 
> Signed-off-by: Jingoo Han <jg1.han@...sung.com>
> Acked-by: Nishanth Menon <nm@...com>
> ---
>  drivers/regulator/twl-regulator.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

[.....]

> @@ -1217,7 +1217,6 @@ static int twlreg_remove(struct platform_device *pdev)
>  	struct regulator_dev *rdev = platform_get_drvdata(pdev);
>  	struct twlreg_info *info = rdev->reg_data;
> 
> -	regulator_unregister(rdev);
>  	kfree(info);
>  	return 0;
>  }

kfree(info) is kfree(rdev->reg_data).
The following would be right.
  1. kfree(rdev->reg_data)
  2. regulator_unregister(rdev)

Also, regulator_unregister() does not access 'rdev->reg_data'.
So, it would not make the problem.

Best regards,
Jingoo Han

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