From: Mike Snitzer <[email-masked]>

Avoid dereferencing a NULL pointer if the number of feature arguments
supplied is fewer than indicated.

Signed-off-by: Mike Snitzer <[email-masked]>
Signed-off-by: Alasdair G Kergon <[email-masked]>
Cc: [email-masked]

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

Index: linux-3.0/drivers/md/dm-mpath.c
===================================================================
--- linux-3.0.orig/drivers/md/dm-mpath.c
+++ linux-3.0/drivers/md/dm-mpath.c
@@ -807,6 +807,11 @@ static int parse_features(struct arg_set
 	if (!argc)
 		return 0;
 
+	if (argc > as->argc) {
+		ti->error = "not enough arguments for features";
+		return -EINVAL;
+	}
+
 	do {
 		param_name = shift(as);
 		argc--;