All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: re: driver core: add test of driver remove calls during probe
Date: Tue, 11 Oct 2016 07:17:37 +0000	[thread overview]
Message-ID: <20161011071737.GA6433@mwanda> (raw)

Hello Rob Herring,

This is a semi-automatic email about new static checker warnings.

The patch bea5b158ff0d: "driver core: add test of driver remove calls 
during probe" from Aug 11, 2016, leads to the following Smatch 
complaint:

drivers/base/dd.c:386 really_probe()
	 warn: variable dereferenced before check 'dev->bus' (see line 373)

drivers/base/dd.c
   372	
   373		if (dev->bus->probe) {
                    ^^^^^^^^^^^^^^^
Old code just dereferenced ->bus without checking.

   374			ret = dev->bus->probe(dev);
   375			if (ret)
   376				goto probe_failed;
   377		} else if (drv->probe) {
   378			ret = drv->probe(dev);
   379			if (ret)
   380				goto probe_failed;
   381		}
   382	
   383		if (test_remove) {
   384			test_remove = false;
   385	
   386			if (dev->bus && dev->bus->remove)
                            ^^^^^^^^
So this test can probably be removed.

   387				dev->bus->remove(dev);
   388			else if (drv->remove)

regards,
dan carpenter

                 reply	other threads:[~2016-10-11  7:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20161011071737.GA6433@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.