summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2022-01-16 04:22:11 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-23 12:03:16 +0100
commit3eb5185896a68373714dc7d0009111744adc3345 (patch)
treeae6e855db6b7184f7c071e0fb6607c4fa23e5c75
parenteb03cb6e03ffd9173e18e5fe87e4e3ce83820453 (diff)
downloadlinux-stable-3eb5185896a68373714dc7d0009111744adc3345.tar.gz
linux-stable-3eb5185896a68373714dc7d0009111744adc3345.tar.bz2
linux-stable-3eb5185896a68373714dc7d0009111744adc3345.zip
mtd: parsers: qcom: Fix missing free for pparts in cleanup
commit 3dd8ba961b9356c4113b96541c752c73d98fef70 upstream. 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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/mtd/parsers/qcomsmempart.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mtd/parsers/qcomsmempart.c b/drivers/mtd/parsers/qcomsmempart.c
index f4fc7635c1f3..32ddfea70142 100644
--- a/drivers/mtd/parsers/qcomsmempart.c
+++ b/drivers/mtd/parsers/qcomsmempart.c
@@ -173,6 +173,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[] = {