Skip to content

Commit 9f7e628

Browse files
Yuuoniymiquelraynal
authored andcommitted
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: 2379608 ("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
1 parent a61528d commit 9f7e628

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/mtd/parsers/redboot.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ static void parse_redboot_of(struct mtd_info *master)
5858
return;
5959

6060
ret = of_property_read_u32(npart, "fis-index-block", &dirblock);
61+
of_node_put(npart);
6162
if (ret)
6263
return;
6364

0 commit comments

Comments
 (0)