mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] ipmi: Fix NULL pointer dereference in ssif_probe
Date: Fri, 31 Aug 2018 14:15:32 -0500	[thread overview]
Message-ID: <6efd45da-8b35-b1c8-bd0e-148c578c99f5@acm.org> (raw)
In-Reply-To: <20180831150034.GA22019@embeddedor.com>

On 08/31/2018 10:00 AM, Gustavo A. R. Silva wrote:
> There is a potential execution path in which function ssif_info_find()
> returns NULL, hence there is a NULL pointer dereference when accessing
> pointer *addr_info*
>
> Fix this by null checking *addr_info* before dereferencing it.

Thanks for catching this quickly, before it went out.  It's merged into 
my next tree.

-corey

> Addresses-Coverity-ID: 1473145 ("Explicit null dereferenced")
> Fixes: e333054a91d1 ("ipmi: Fix I2C client removal in the SSIF driver")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
> Changes in v2:
>   - Fix typo in commit log.
>
>   drivers/char/ipmi/ipmi_ssif.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
> index 2ff3679..764d305 100644
> --- a/drivers/char/ipmi/ipmi_ssif.c
> +++ b/drivers/char/ipmi/ipmi_ssif.c
> @@ -1641,7 +1641,9 @@ static int ssif_probe(struct i2c_client *client, const struct i2c_device_id *id)
>   
>    out:
>   	if (rv) {
> -		addr_info->client = NULL;
> +		if (addr_info)
> +			addr_info->client = NULL;
> +
>   		dev_err(&client->dev, "Unable to start IPMI SSIF: %d\n", rv);
>   		kfree(ssif_info);
>   	}



  reply	other threads:[~2018-08-31 19:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31 15:00 Gustavo A. R. Silva
2018-08-31 19:15 ` Corey Minyard [this message]
2018-08-31 20:49   ` Gustavo A. R. Silva

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=6efd45da-8b35-b1c8-bd0e-148c578c99f5@acm.org \
    --to=minyard@acm.org \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo@embeddedor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    /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®