]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
dm ioctl: fix error return code in target_message
authorQinglang Miao <miaoqinglang@huawei.com>
Sat, 28 Nov 2020 10:19:59 +0000 (18:19 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:26:00 +0000 (11:26 +0100)
[ 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>
drivers/md/dm-ioctl.c

index f666778ad23728cdc323f7570d837ebb30ede660..439277f48ff8bacce3720a90bf1221fe8da28af3 100644 (file)
@@ -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;
        }