Skip to content

Commit 37b4599

Browse files
Tom Rixkdave
authored andcommitted
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: 1a15eb7 ("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>
1 parent 28b21c5 commit 37b4599

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3353,7 +3353,7 @@ static long btrfs_ioctl_rm_dev(struct file *file, void __user *arg)
33533353
struct block_device *bdev = NULL;
33543354
fmode_t mode;
33553355
int ret;
3356-
bool cancel;
3356+
bool cancel = false;
33573357

33583358
if (!capable(CAP_SYS_ADMIN))
33593359
return -EPERM;

0 commit comments

Comments
 (0)