mtd: partitions: Fix refcount leak in parse_redboot_of
[ Upstream commit9f7e62815c] 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:2379608809("mtd: partitions: redboot: seek fis-index-block in the right node") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220526110652.64849-1-linmq006@gmail.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b4e150d295
commit
55d0f7da66
1 changed files with 1 additions and 0 deletions
|
|
@ -58,6 +58,7 @@ static void parse_redboot_of(struct mtd_info *master)
|
|||
return;
|
||||
|
||||
ret = of_property_read_u32(npart, "fis-index-block", &dirblock);
|
||||
of_node_put(npart);
|
||||
if (ret)
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue