提交 9f7e6281 编写于 作者: M Miaoqian Lin 提交者: Miquel Raynal

mtd: partitions: Fix refcount leak in parse_redboot_of

of_get_child_by_name() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.

Fixes: 23796088 ("mtd: partitions: redboot: seek fis-index-block in the right node")
Signed-off-by: NMiaoqian Lin <linmq006@gmail.com>
Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220526110652.64849-1-linmq006@gmail.com
上级 a61528d9
...@@ -58,6 +58,7 @@ static void parse_redboot_of(struct mtd_info *master) ...@@ -58,6 +58,7 @@ static void parse_redboot_of(struct mtd_info *master)
return; return;
ret = of_property_read_u32(npart, "fis-index-block", &dirblock); ret = of_property_read_u32(npart, "fis-index-block", &dirblock);
of_node_put(npart);
if (ret) if (ret)
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册