diff options
author | Ansuel Smith <ansuelsmth@gmail.com> | 2022-01-16 04:22:11 +0100 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2022-01-25 10:32:07 +0100 |
commit | 3dd8ba961b9356c4113b96541c752c73d98fef70 (patch) | |
tree | 215b557750ef5f71964ceec58c6ec431c51f13d6 /drivers/mtd/parsers | |
parent | 65d003cca335cabc0160d3cd7daa689eaa9dd3cd (diff) | |
download | linux-3dd8ba961b9356c4113b96541c752c73d98fef70.tar.gz linux-3dd8ba961b9356c4113b96541c752c73d98fef70.tar.bz2 linux-3dd8ba961b9356c4113b96541c752c73d98fef70.zip |
mtd: parsers: qcom: Fix missing free for pparts in cleanup
Mtdpart doesn't free pparts when a cleanup function is declared.
Add missing free for pparts in cleanup function for smem to fix the
leak.
Fixes: 10f3b4d79958 ("mtd: parsers: qcom: Fix leaking of partition name")
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220116032211.9728-2-ansuelsmth@gmail.com
Diffstat (limited to 'drivers/mtd/parsers')
-rw-r--r-- | drivers/mtd/parsers/qcomsmempart.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mtd/parsers/qcomsmempart.c b/drivers/mtd/parsers/qcomsmempart.c index 469d466f568f..4311b89d8df0 100644 --- a/drivers/mtd/parsers/qcomsmempart.c +++ b/drivers/mtd/parsers/qcomsmempart.c @@ -174,6 +174,8 @@ static void parse_qcomsmem_cleanup(const struct mtd_partition *pparts, for (i = 0; i < nr_parts; i++) kfree(pparts[i].name); + + kfree(pparts); } static const struct of_device_id qcomsmem_of_match_table[] = { |