public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: Axel Lin <axel.lin@ingics.com>
Cc: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] regulator: fan53555: Fix null pointer dereference
Date: Thu, 18 Sep 2014 16:22:30 +0200	[thread overview]
Message-ID: <6627306.hr5KNyAzfJ@diego> (raw)
In-Reply-To: <1411048178.18649.2.camel@phoenix>

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


  reply	other threads:[~2014-09-18 14:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6627306.hr5KNyAzfJ@diego \
    --to=heiko@sntech.de \
    --cc=axel.lin@ingics.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox