public inbox for linux-bcache@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: koverstreet@google.com
Cc: linux-bcache@vger.kernel.org
Subject: re: bcache: Fix error handling in init code
Date: Mon, 7 Jul 2014 17:15:37 +0300	[thread overview]
Message-ID: <20140707141537.GA15176@mwanda> (raw)

Hello Kent Overstreet,

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

The patch f59fce847fc8: "bcache: Fix error handling in init code"
from May 15, 2013, leads to the following Smatch complaint:

drivers/md/bcache/super.c:1088 cached_dev_free()
	 error: we previously assumed 'dc->bdev->bd_disk' could be null (see line 1085)

drivers/md/bcache/super.c
  1084		if (!IS_ERR_OR_NULL(dc->bdev)) {
  1085			if (dc->bdev->bd_disk)
                            ^^^^^^^^^^^^^^^^^
The patch introduces a new check.

  1086				blk_sync_queue(bdev_get_queue(dc->bdev));
  1087	
  1088			blkdev_put(dc->bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL);

But "dc->bdev->bd_disk" is dereferenced inside the call to blkdev_put().

  1089		}
  1090	

regards,
dan carpenter

                 reply	other threads:[~2014-07-07 14:15 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=20140707141537.GA15176@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=koverstreet@google.com \
    --cc=linux-bcache@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