summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorQinglang Miao <miaoqinglang@huawei.com>2020-11-28 13:19:59 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-30 13:53:36 +0300
commit6a579661e5840a0d2a0641f32e3ebc8259fc8597 (patch)
tree1cfecabfa364e4ec4390f8de8facc2027d0fb480 /drivers/md
parent54919a7153240810f62a0b378a9b97560374e617 (diff)
downloadlinux-6a579661e5840a0d2a0641f32e3ebc8259fc8597.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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index cd0478d44058..5e306bba4375 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -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;
}