From: Mikulas Patocka <[email-masked]>

Fix arg count parsing error in hw handlers.

Cc: [email-masked]
Signed-off-by: Mikulas Patocka <[email-masked]>
Signed-off-by: Alasdair G Kergon <[email-masked]>

---
 drivers/md/dm-mpath.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: linux-2.6.30/drivers/md/dm-mpath.c
===================================================================
--- linux-2.6.30.orig/drivers/md/dm-mpath.c
+++ linux-2.6.30/drivers/md/dm-mpath.c
@@ -705,6 +705,11 @@ static int parse_hw_handler(struct arg_s
 	if (!hw_argc)
 		return 0;
 
+	if (hw_argc > as->argc) {
+		ti->error = "not enough arguments for hardware handler";
+		return -EINVAL;
+	}
+
 	m->hw_handler_name = kstrdup(shift(as), GFP_KERNEL);
 	request_module("scsi_dh_%s", m->hw_handler_name);
 	if (scsi_dh_handler_exist(m->hw_handler_name) == 0) {