From: Mikulas Patocka Date: Mon, 21 Jul 2008 11:00:24 +0000 (+0100) Subject: dm mpath: free path selector on invalid args X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=371b2e348b7731a548b0a7432ca2ba32e90dd16f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Alasdair G Kergon --- 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, } 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) {