Skip to content

Commit

Permalink
dm ioctl: fix error return code in target_message
Browse files Browse the repository at this point in the history
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 2ca4c92 ("dm ioctl: prevent empty message")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Qinglang Miao authored and Mike Snitzer committed Dec 4, 2020
1 parent e8dc79d commit 4d7659b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/md/dm-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1600,6 +1600,7 @@ static int target_message(struct file *filp, struct dm_ioctl *param, size_t para

if (!argc) {
DMWARN("Empty message received.");
r = -EINVAL;
goto out_argv;
}

Expand Down

0 comments on commit 4d7659b

Please sign in to comment.