From 352c210f3f78b197b89d5261bd86cf49d7656b7d Mon Sep 17 00:00:00 2001 From: Alasdair G Kergon Date: Mon, 25 Jul 2011 10:50:00 +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