diff options
author | Qinglang Miao <miaoqinglang@huawei.com> | 2020-11-28 13:19:59 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-12-30 13:26:00 +0300 |
commit | ef6082dfafdbfcf2eb7b3077f56f02871a9cc2c8 (patch) | |
tree | d142a138ea694b8656488714e24e35da06747f1c /drivers/md | |
parent | f9b158b58f213d76f5c0b25b3885b63136b74511 (diff) | |
download | linux-ef6082dfafdbfcf2eb7b3077f56f02871a9cc2c8.tar.xz |
dm ioctl: fix error return code in target_message
[ Upstream commit 4d7659bfbe277a43399a4a2d90fca141e70f29e1 ]
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.
Fixes: 2ca4c92f58f9 ("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>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-ioctl.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index f666778ad237..439277f48ff8 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1575,6 +1575,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; } |