]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: test for valid bdev before kobj removal in btrfs_rm_device
authorEric Sandeen <sandeen@redhat.com>
Mon, 7 Jul 2014 17:34:49 +0000 (12:34 -0500)
committerChris Mason <clm@fb.com>
Sat, 19 Jul 2014 18:49:44 +0000 (11:49 -0700)
commitdd072549df88611158639e7decce0b0a210c0580
tree4c9a5a9f514ea6d955856b9ed28a3b63b3460b42
parent8d5e819e6eb68f9e61ad61dc1e73b05059a9e882
btrfs: test for valid bdev before kobj removal in btrfs_rm_device

commit a737b3f btrfs: dev delete should remove sysfs entry
added a btrfs_kobj_rm_device, which dereferences device->bdev...
right after we check whether device->bdev might be NULL.

I don't honestly know if it's possible to have a NULL device->bdev
here, but assuming that it is (given the test), we need to move
the kobject removal to be under that test.

(Coverity spotted this)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/volumes.c