Skip to content

Commit 3dd8ba9

Browse files
Ansuelmiquelraynal
authored andcommitted
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: 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
1 parent 65d003c commit 3dd8ba9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/mtd/parsers/qcomsmempart.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ static void parse_qcomsmem_cleanup(const struct mtd_partition *pparts,
174174

175175
for (i = 0; i < nr_parts; i++)
176176
kfree(pparts[i].name);
177+
178+
kfree(pparts);
177179
}
178180

179181
static const struct of_device_id qcomsmem_of_match_table[] = {

0 commit comments

Comments
 (0)