From: Lee Jones <lee.jones@linaro.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mfd: Fix potential NULL pointer dereference
Date: Mon, 17 Jul 2017 13:21:20 +0100 [thread overview]
Message-ID: <20170717122120.uxevckop5mgzttid@dell> (raw)
In-Reply-To: <20170705055054.8022-1-christophe.jaillet@wanadoo.fr>
On Wed, 05 Jul 2017, Christophe JAILLET wrote:
> if 'max8998_i2c_parse_dt_pdata() fails (when out of memory), a NULL
> pointer dereference will occur in the error handling code.
>
> Return directly instead.
>
> Fixes: ee999fb3f17f("mfd: max8998: Add support for Device Tree")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/mfd/max8998.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Applied, thanks.
> diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c
> index 4c33b8063bc3..b1d3f70782d9 100644
> --- a/drivers/mfd/max8998.c
> +++ b/drivers/mfd/max8998.c
> @@ -192,10 +192,8 @@ static int max8998_i2c_probe(struct i2c_client *i2c,
>
> if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node) {
> pdata = max8998_i2c_parse_dt_pdata(&i2c->dev);
> - if (IS_ERR(pdata)) {
> - ret = PTR_ERR(pdata);
> - goto err;
> - }
> + if (IS_ERR(pdata))
> + return PTR_ERR(pdata);
> }
>
> i2c_set_clientdata(i2c, max8998);
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
prev parent reply other threads:[~2017-07-17 12:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-05 5:50 Christophe JAILLET
2017-07-17 12:21 ` Lee Jones [this message]
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=20170717122120.uxevckop5mgzttid@dell \
--to=lee.jones@linaro.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=kernel-janitors@vger.kernel.org \
--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
all inboxes | Powered by JetHome®