Skip to contentSkip to conversation

dm ioctl: fix error return code in target_message

PATCH New Qinglang Miao 1 participant 1 message Nov 28, 2020 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 dm ioctl: fix error return code in target_message

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")
---
 drivers/md/dm-ioctl.c | 1 +
 1 file changed, 1 insertion(+)
drivers/md/dm-ioctl.c +1 -0
index cd0478d44..5e306bba4 100644
@@ -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;
 	}
 
Signature · 1 line
2.23.0