From 49bea2517b6b86d03867b5b753cdd505f00df864 Mon Sep 17 00:00:00 2001 From: Alasdair G Kergon Date: Tue, 2 Aug 2011 10:25:29 +1000 Subject: [PATCH] Detect invalid empty messages in core dm instead of requiring every target to check this. Signed-off-by: Alasdair G Kergon --- drivers/md/dm-ioctl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 03f8af5d244a..2e9a3ca37bdd 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1424,6 +1424,11 @@ static int target_message(struct dm_ioctl *param, size_t param_size) goto out; } + if (!argc) { + DMWARN("Empty message received."); + goto out; + } + table = dm_get_live_table(md); if (!table) goto out_argv; -- 2.39.5