Skip to content

Commit

Permalink
mtd: parsers: qcom: Fix missing free for pparts in cleanup
Browse files Browse the repository at this point in the history
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: 10f3b4d ("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
  • Loading branch information
Ansuel Smith authored and Miquel Raynal committed Jan 25, 2022
1 parent 65d003c commit 3dd8ba9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/mtd/parsers/qcomsmempart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down

0 comments on commit 3dd8ba9

Please sign in to comment.