]> git.ipfire.org Git - thirdparty/kernel/stable.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>
Tue, 29 Dec 2020 12:42:38 +0000 (13:42 +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 9371194677dc3f08e311d8c14ee31e5422938c7d..eab3f7325e3102e95b3a1364ff4a5a267ae923be 100644 (file)
@@ -1539,6 +1539,7 @@ static int target_message(struct dm_ioctl *param, size_t param_size)
 
        if (!argc) {
                DMWARN("Empty message received.");
+               r = -EINVAL;
                goto out_argv;
        }