All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: jeffm@suse.com
Cc: linux-btrfs@vger.kernel.org
Subject: [bug report] btrfs: root->fs_info cleanup, add fs_info convenience variables
Date: Fri, 8 Jul 2016 19:40:37 +0300	[thread overview]
Message-ID: <20160708164037.GA7997@mwanda> (raw)

Hello Jeff Mahoney,

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

The patch b286384aac32: "btrfs: root->fs_info cleanup, add fs_info
convenience variables" from Jun 22, 2016, leads to the following
Smatch complaint:

fs/btrfs/export.c:238 btrfs_get_name()
	 warn: variable dereferenced before check 'inode' (see line 226)

fs/btrfs/export.c
   225		struct inode *dir = d_inode(parent);
   226		struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
                                                         ^^^^^^^^^^^
New dereference.

   227		struct btrfs_path *path;
   228		struct btrfs_root *root = BTRFS_I(dir)->root;
   229		struct btrfs_inode_ref *iref;
   230		struct btrfs_root_ref *rref;
   231		struct extent_buffer *leaf;
   232		unsigned long name_ptr;
   233		struct btrfs_key key;
   234		int name_len;
   235		int ret;
   236		u64 ino;
   237	
   238		if (!dir || !inode)
                             ^^^^^
Old code assumed it can be NULL.

   239			return -EINVAL;
   240	

regards,
dan carpenter

             reply	other threads:[~2016-07-08 16:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-08 16:40 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-12-22 12:53 [bug report] btrfs: root->fs_info cleanup, add fs_info convenience variables Dan Carpenter
2016-12-22 14:18 ` Jeff Mahoney

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=20160708164037.GA7997@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=jeffm@suse.com \
    --cc=linux-btrfs@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.