diff options
| author | Mikulas Patocka <mpatocka@redhat.com> | 2008-07-21 07:00:24 -0400 |
|---|---|---|
| committer | Alasdair G Kergon <agk@redhat.com> | 2008-07-21 07:00:24 -0400 |
| commit | 371b2e348b7731a548b0a7432ca2ba32e90dd16f (patch) | |
| tree | d7adce2fcaf95bfbbdfd4779d0e03e2980308b65 | |
| parent | 5b664cb235e97afbf34db9c4d77f08ebd725335e (diff) | |
dm mpath: free path selector on invalid args
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>
| -rw-r--r-- | drivers/md/dm-mpath.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 9f7302d4878d..9f570b2ab7b4 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c | |||
| @@ -525,8 +525,10 @@ static int parse_path_selector(struct arg_set *as, struct priority_group *pg, | |||
| 525 | } | 525 | } |
| 526 | 526 | ||
| 527 | r = read_param(_params, shift(as), &ps_argc, &ti->error); | 527 | r = read_param(_params, shift(as), &ps_argc, &ti->error); |
| 528 | if (r) | 528 | if (r) { |
| 529 | dm_put_path_selector(pst); | ||
| 529 | return -EINVAL; | 530 | return -EINVAL; |
| 531 | } | ||
| 530 | 532 | ||
| 531 | r = pst->create(&pg->ps, ps_argc, as->argv); | 533 | r = pst->create(&pg->ps, ps_argc, as->argv); |
| 532 | if (r) { | 534 | if (r) { |
