mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Corey Minyard <minyard@acm.org>, 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] ipmi: Fix NULL pointer dereference in ssif_probe
Date: Fri, 31 Aug 2018 09:58:07 -0500	[thread overview]
Message-ID: <b38d70e9-d945-ac20-c411-0e9fdeea9e1d@embeddedor.com> (raw)
In-Reply-To: <20180831141451.GA19032@embeddedor.com>

Hi all,

I found a typo in the commit log.

I'll send v2 shortly.

Thanks
--
Gustavo

On 8/31/18 9:14 AM, Gustavo A. R. Silva wrote:
> There is a potential execution patch 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.
> 
> 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>
> ---
>  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 14:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31 14:14 Gustavo A. R. Silva
2018-08-31 14:58 ` Gustavo A. R. Silva [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=b38d70e9-d945-ac20-c411-0e9fdeea9e1d@embeddedor.com \
    --to=gustavo@embeddedor.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minyard@acm.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®