]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: fix potential oops in device_list_add
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 27 Jan 2019 04:58:00 +0000 (04:58 +0000)
committerDavid Sterba <dsterba@suse.com>
Wed, 30 Jan 2019 17:16:40 +0000 (18:16 +0100)
commitc65cb73f9f32282c1788309f2d00beafe86721a4
tree16fe4e2b48d4610448fe00759383ad686838ce08
parenteccb9f81c7682696606c198a29bf63e55ed6ea51
btrfs: fix potential oops in device_list_add

alloc_fs_devices() can return ERR_PTR(-ENOMEM), so dereferencing its
result before the check for IS_ERR() is a bad idea.

Fixes: 927a35a93b9fb ("btrfs: add members to fs_devices to track fsid changes")
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c