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
[ Upstream commit 4d7659b ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Qinglang Miao authored and gregkh committed Dec 30, 2020
1 parent d863d76 commit 675b3ba
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/md/dm-ioctl.c
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 675b3ba

Please sign in to comment.