]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: fix error pointer dereference in btrfs_ioctl_rm_dev_v2()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 16 Nov 2021 11:50:25 +0000 (14:50 +0300)
committerDavid Sterba <dsterba@suse.com>
Wed, 8 Dec 2021 14:40:19 +0000 (15:40 +0100)
commitd815b3f2f273537cb8afaf5ab11a46851f6c03e5
tree07696c1757f62c1b5b4b208bae0a72b75b145890
parentdaf87e953527b03c0bd4c0f41d704ba71186256d
btrfs: fix error pointer dereference in btrfs_ioctl_rm_dev_v2()

If memdup_user() fails the error handing will crash when it tries
to kfree() an error pointer.  Just return directly because there is
no cleanup required.

Fixes: 1a15eb724aae ("btrfs: use btrfs_get_dev_args_from_path in dev removal ioctls")
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c