public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: fan53555: Fixup report wrong vendor message
@ 2014-09-18 13:48 Axel Lin
  2014-09-18 13:49 ` [PATCH 2/2] regulator: fan53555: Fix null pointer dereference Axel Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Axel Lin @ 2014-09-18 13:48 UTC (permalink / raw)
  To: Mark Brown; +Cc: Heiko Stuebner, Liam Girdwood, linux-kernel@vger.kernel.org

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/fan53555.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
index f2f5535..70b31bf 100644
--- a/drivers/regulator/fan53555.c
+++ b/drivers/regulator/fan53555.c
@@ -267,8 +267,7 @@ static int fan53555_device_setup(struct fan53555_device_info *di,
 		ret = fan53555_voltages_setup_silergy(di);
 		break;
 	default:
-		dev_err(di->dev,
-			"vendor %d not supported!\n", di->chip_id);
+		dev_err(di->dev, "vendor %d not supported!\n", di->vendor);
 		return -EINVAL;
 	}
 
-- 
1.9.1




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] regulator: fan53555: Fix null pointer dereference
  2014-09-18 13:48 [PATCH 1/2] regulator: fan53555: Fixup report wrong vendor message Axel Lin
@ 2014-09-18 13:49 ` Axel Lin
  2014-09-18 14:22   ` Heiko Stübner
  2014-09-18 14:23 ` [PATCH 1/2] regulator: fan53555: Fixup report wrong vendor message Heiko Stübner
  2014-09-18 18:09 ` Mark Brown
  2 siblings, 1 reply; 5+ messages in thread
From: Axel Lin @ 2014-09-18 13:49 UTC (permalink / raw)
  To: Mark Brown; +Cc: Heiko Stuebner, Liam Girdwood, linux-kernel@vger.kernel.org

Set di->regulator before dereference it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/fan53555.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
index 70b31bf..c82fb9e 100644
--- a/drivers/regulator/fan53555.c
+++ b/drivers/regulator/fan53555.c
@@ -361,6 +361,7 @@ static int fan53555_regulator_probe(struct i2c_client *client,
 	if (!di)
 		return -ENOMEM;
 
+	di->regulator = pdata->regulator;
 	if (client->dev.of_node) {
 		const struct of_device_id *match;
 
@@ -389,7 +390,6 @@ static int fan53555_regulator_probe(struct i2c_client *client,
 		return PTR_ERR(di->regmap);
 	}
 	di->dev = &client->dev;
-	di->regulator = pdata->regulator;
 	i2c_set_clientdata(client, di);
 	/* Get chip ID */
 	ret = regmap_read(di->regmap, FAN53555_ID1, &val);
-- 
1.9.1




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] regulator: fan53555: Fix null pointer dereference
  2014-09-18 13:49 ` [PATCH 2/2] regulator: fan53555: Fix null pointer dereference Axel Lin
@ 2014-09-18 14:22   ` Heiko Stübner
  0 siblings, 0 replies; 5+ messages in thread
From: Heiko Stübner @ 2014-09-18 14:22 UTC (permalink / raw)
  To: Axel Lin; +Cc: Mark Brown, Liam Girdwood, linux-kernel@vger.kernel.org

Am Donnerstag, 18. September 2014, 21:49:38 schrieb Axel Lin:
> Set di->regulator before dereference it.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

damn ... thanks for catching this :-)

Reviewed-by: Heiko Stuebner <heiko@sntech.de>


> ---
>  drivers/regulator/fan53555.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
> index 70b31bf..c82fb9e 100644
> --- a/drivers/regulator/fan53555.c
> +++ b/drivers/regulator/fan53555.c
> @@ -361,6 +361,7 @@ static int fan53555_regulator_probe(struct i2c_client
> *client, if (!di)
>  		return -ENOMEM;
> 
> +	di->regulator = pdata->regulator;
>  	if (client->dev.of_node) {
>  		const struct of_device_id *match;
> 
> @@ -389,7 +390,6 @@ static int fan53555_regulator_probe(struct i2c_client
> *client, return PTR_ERR(di->regmap);
>  	}
>  	di->dev = &client->dev;
> -	di->regulator = pdata->regulator;
>  	i2c_set_clientdata(client, di);
>  	/* Get chip ID */
>  	ret = regmap_read(di->regmap, FAN53555_ID1, &val);


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] regulator: fan53555: Fixup report wrong vendor message
  2014-09-18 13:48 [PATCH 1/2] regulator: fan53555: Fixup report wrong vendor message Axel Lin
  2014-09-18 13:49 ` [PATCH 2/2] regulator: fan53555: Fix null pointer dereference Axel Lin
@ 2014-09-18 14:23 ` Heiko Stübner
  2014-09-18 18:09 ` Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Heiko Stübner @ 2014-09-18 14:23 UTC (permalink / raw)
  To: Axel Lin; +Cc: Mark Brown, Liam Girdwood, linux-kernel@vger.kernel.org

Am Donnerstag, 18. September 2014, 21:48:48 schrieb Axel Lin:
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

thanks for catching this silly mistake

Reviewed-by: Heiko Stuebner <heiko@sntech.de>


> ---
>  drivers/regulator/fan53555.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
> index f2f5535..70b31bf 100644
> --- a/drivers/regulator/fan53555.c
> +++ b/drivers/regulator/fan53555.c
> @@ -267,8 +267,7 @@ static int fan53555_device_setup(struct
> fan53555_device_info *di, ret = fan53555_voltages_setup_silergy(di);
>  		break;
>  	default:
> -		dev_err(di->dev,
> -			"vendor %d not supported!\n", di->chip_id);
> +		dev_err(di->dev, "vendor %d not supported!\n", di->vendor);
>  		return -EINVAL;
>  	}


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] regulator: fan53555: Fixup report wrong vendor message
  2014-09-18 13:48 [PATCH 1/2] regulator: fan53555: Fixup report wrong vendor message Axel Lin
  2014-09-18 13:49 ` [PATCH 2/2] regulator: fan53555: Fix null pointer dereference Axel Lin
  2014-09-18 14:23 ` [PATCH 1/2] regulator: fan53555: Fixup report wrong vendor message Heiko Stübner
@ 2014-09-18 18:09 ` Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2014-09-18 18:09 UTC (permalink / raw)
  To: Axel Lin; +Cc: Heiko Stuebner, Liam Girdwood, linux-kernel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 129 bytes --]

On Thu, Sep 18, 2014 at 09:48:48PM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Applied both, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-18 18:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-18 13:48 [PATCH 1/2] regulator: fan53555: Fixup report wrong vendor message Axel Lin
2014-09-18 13:49 ` [PATCH 2/2] regulator: fan53555: Fix null pointer dereference Axel Lin
2014-09-18 14:22   ` Heiko Stübner
2014-09-18 14:23 ` [PATCH 1/2] regulator: fan53555: Fixup report wrong vendor message Heiko Stübner
2014-09-18 18:09 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox