From: Mikulas Patocka Date: Mon, 11 May 2026 11:04:16 +0000 (+0200) Subject: dm-ioctl: report an error if a device has no table X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=457e32348d606a77f9b20e25e989734189834c07;p=thirdparty%2Flinux.git dm-ioctl: report an error if a device has no table When we send a message to a device that has no table, the return code was not set. The code would return "2", which is not considered a valid return value. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Reviewed-by: Benjamin Marzinski --- diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index b92ec3efff01c..ac77dc0ca2255 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1938,8 +1938,11 @@ static int target_message(struct file *filp, struct dm_ioctl *param, size_t para goto out_argv; table = dm_get_live_table(md, &srcu_idx); - if (!table) + if (!table) { + DMERR("The device has no table."); + r = -EINVAL; goto out_table; + } if (dm_deleting_md(md)) { r = -ENXIO;