]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: remove redundant inode null check
authorColin Ian King <colin.king@canonical.com>
Tue, 20 Dec 2016 16:18:37 +0000 (16:18 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 14 Feb 2017 14:50:50 +0000 (15:50 +0100)
commitb4125480a40ce7470299eed0d6deaa95f85194cb
treec324a380c6fd48d535c53d3cce61926c37291437
parent5cf701354576b22ec159643d51c035f8b8eb0347
btrfs: remove redundant inode null check

The check for a null inode is redundant since the function
is a callback for exportfs, which will itself crash if
dentry->d_inode or parent->d_inode is NULL.  Removing the
null check makes this consistent with other file systems.

Also remove the redundant null dir check too.

Found with static analysis by CoverityScan, CID 1389472

Kudos to Jeff Mahoney for reviewing and explaining the error in
my original patch (most of this explanation went into the above
commit message) and David Sterba for pointing out that the dir
check is also redundant.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/export.c