Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mikulas Patocka and committed by
Alasdair G Kergon
371b2e34 5b664cb2

+3 -1
+3 -1
drivers/md/dm-mpath.c
··· 525 525 } 526 526 527 527 r = read_param(_params, shift(as), &ps_argc, &ti->error); 528 - if (r) 528 + if (r) { 529 + dm_put_path_selector(pst); 529 530 return -EINVAL; 531 + } 530 532 531 533 r = pst->create(&pg->ps, ps_argc, as->argv); 532 534 if (r) {