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, 9 Aug 2010 08:35:08 +0100
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Axel Lin <axel.lin@...il.com>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>,
	Liam Girdwood <lrg@...mlogic.co.uk>,
	Anuj Aggarwal <anuj.aggarwal@...com>
Subject: Re: [PATCH] regulator: tps6507x - add missing platform_set_drvdata in tps6507x_pmic_probe


On 9 Aug 2010, at 04:27, Axel Lin <axel.lin@...il.com> wrote:

> We should call platform_set_drvdata() before calling platform_get_drvdata().
> 
> Signed-off-by: Axel Lin <axel.lin@...il.com>
> ---
> drivers/regulator/tps6507x-regulator.c |    2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c
> index 8152d65..fbe21f7 100644
> --- a/drivers/regulator/tps6507x-regulator.c
> +++ b/drivers/regulator/tps6507x-regulator.c
> @@ -614,6 +614,7 @@ int tps6507x_pmic_probe(struct platform_device *pdev)
>  	}
> 
>  	tps6507x_dev->pmic = tps;
> +	platform_set_drvdata(pdev, tps6507x_dev);
> 
>  	return 0;
> 
> @@ -640,6 +641,7 @@ static int __devexit tps6507x_pmic_remove(struct platform_device *pdev)
>  	for (i = 0; i < TPS6507X_NUM_REGULATOR; i++)
>  		regulator_unregister(tps->rdev[i]);
> 
> +	platform_set_drvdata(pdev, NULL);
>  	kfree(tps);

This is not needed - we're unbinding the driver so should no longer be looking at the driver data.

> 
>  	return 0;
> -- 
> 1.5.4.3
> 
> 
> 
--
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