From: Mike Snitzer Date: Tue, 2 Aug 2011 00:25:20 +0000 (+1000) Subject: Avoid dereferencing a NULL pointer if the number of feature arguments X-Git-Tag: next-20110802~22^2~38 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=20a557adaccad3e3887f6a3d1da8354155686ed4;p=karo-tx-linux.git Avoid dereferencing a NULL pointer if the number of feature arguments supplied is fewer than indicated. Signed-off-by: Mike Snitzer Signed-off-by: Alasdair G Kergon Cc: stable@kernel.org --- diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index aa4e570c2cb5..209991bebd30 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -807,6 +807,11 @@ static int parse_features(struct arg_set *as, struct multipath *m) if (!argc) return 0; + if (argc > as->argc) { + ti->error = "not enough arguments for features"; + return -EINVAL; + } + do { param_name = shift(as); argc--;