Skip to content

Commit

Permalink
dm mpath: free path selector on invalid args
Browse files Browse the repository at this point in the history
Free path selector if the arguments are invalid.

This command (note that it is invalid) causes reference leak on module
"dm_round_robin" and prevents the module from being removed.

dmsetup create --table '0 2 multipath 0 0 1 1 round-robin /dev/sdh' mpath0

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Jul 21, 2008
1 parent 5b664cb commit 371b2e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/md/dm-mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,10 @@ static int parse_path_selector(struct arg_set *as, struct priority_group *pg,
}

r = read_param(_params, shift(as), &ps_argc, &ti->error);
if (r)
if (r) {
dm_put_path_selector(pst);
return -EINVAL;
}

r = pst->create(&pg->ps, ps_argc, as->argv);
if (r) {
Expand Down

0 comments on commit 371b2e3

Please sign in to comment.