mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: w1: Fix w1_bq27000
Date: Sun, 19 Feb 2012 12:48:20 +1100	[thread overview]
Message-ID: <20120219124820.4a8989f0@notabene.brown> (raw)
In-Reply-To: <20120218205125.GA26827@elgon.mountain>

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

On Sat, 18 Feb 2012 23:51:25 +0300 Dan Carpenter <dan.carpenter@oracle.com>
wrote:

> Hello NeilBrown,
> 
> This is a semi-automatic email about new static checker warnings.
> 
> The patch 9f3519d2ed26: "w1: Fix w1_bq27000" from Feb 15, 2012, leads 
> to the following Smatch complaint:
> 
> drivers/w1/slaves/w1_bq27000.c:48 w1_bq27000_read()
> 	 warn: variable dereferenced before check 'dev' (see line 46)
> 
> drivers/w1/slaves/w1_bq27000.c
>     45		u8 val;
>     46		struct w1_slave *sl = container_of(dev->parent, struct w1_slave, dev);
>                                                    ^^^^^^^^^^^
> New dereference.
> 
>     47	
>     48		if (!dev)
>                      ^^^
> Old check.
> 
>     49			return 0;
>     50	
> 
> regards,
> dan carpenter

Thanks..
I suspect we should just remove the
   if (!dev)
       return

I should probably get rid of w1_bq27000_write as it is totally unused, and I
need to hold a lock in w1_bq27000_read or I can get really bad things
happening if two threads try to rad the status at the same time.

Ho hum.

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      reply	other threads:[~2012-02-19  1:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-18 20:51 Dan Carpenter
2012-02-19  1:48 ` NeilBrown [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=20120219124820.4a8989f0@notabene.brown \
    --to=neilb@suse.de \
    --cc=dan.carpenter@oracle.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

all inboxes | Powered by JetHome®