mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-12 03:26:26 +00:00
dm mpath: fix potential NULL pointer in feature arg processing
Avoid dereferencing a NULL pointer if the number of feature arguments supplied is fewer than indicated. Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Cc: stable@kernel.org
This commit is contained in:
parent
762a80d9fc
commit
286f367dad
1 changed files with 5 additions and 0 deletions
|
@ -807,6 +807,11 @@ static int parse_features(struct arg_set *as, struct multipath *m)
|
||||||
if (!argc)
|
if (!argc)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (argc > as->argc) {
|
||||||
|
ti->error = "not enough arguments for features";
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
param_name = shift(as);
|
param_name = shift(as);
|
||||||
argc--;
|
argc--;
|
||||||
|
|
Loading…
Reference in a new issue