]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: fix use of uninitialized variable at rm device ioctl
authorTom Rix <trix@redhat.com>
Fri, 21 Jan 2022 13:45:22 +0000 (05:45 -0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 31 Jan 2022 15:06:21 +0000 (16:06 +0100)
commitd07122ce680032516dfded53bcb391ee424cd3db
tree1f5d1e24dce5c05e261d24ae27f8228b30104103
parentf59cfb26aa140c87e987b4918ff04381315ddd20
btrfs: fix use of uninitialized variable at rm device ioctl

Clang static analysis reports this problem
ioctl.c:3333:8: warning: 3rd function call argument is an
  uninitialized value
    ret = exclop_start_or_cancel_reloc(fs_info,

cancel is only set in one branch of an if-check and is always used.  So
initialize to false.

Fixes: 9417d7f2fb0e ("btrfs: use btrfs_get_dev_args_from_path in dev removal ioctls")
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c