Skip to content

Commit 278811d

Browse files
Yang Yingliangmiquelraynal
authored andcommitted
mtd: parsers: scpart: add missing of_node_put() in scpart_parse()
of_get_child_by_name() will increase the refcount of 'ofpart_node', so add of_node_put() after using it to avoid refcount leak. Fixes: 9b78ef0 ("mtd: parsers: add support for Sercomm partitions") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220617014008.851583-1-yangyingliang@huawei.com
1 parent 6f6536a commit 278811d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/mtd/parsers/scpart.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ static int scpart_parse(struct mtd_info *master,
219219
of_node_put(pp);
220220

221221
free:
222+
of_node_put(ofpart_node);
222223
kfree(scpart_map);
223224
if (res <= 0)
224225
kfree(parts);

0 commit comments

Comments
 (0)