summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorMiaoqian Lin <linmq006@gmail.com>2022-05-26 14:06:49 +0300
committerMiquel Raynal <miquel.raynal@bootlin.com>2022-06-09 16:03:32 +0300
commit9f7e62815cf3cbbcb1b8cb21649fb4dfdb3aa016 (patch)
tree2eec70c96c443cd34d7ed389a983e94d62219c80 /drivers/mtd
parenta61528d997619a518ee8c51cf0ef0513021afaff (diff)
downloadlinux-9f7e62815cf3cbbcb1b8cb21649fb4dfdb3aa016.tar.xz
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: 237960880960 ("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
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/parsers/redboot.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/parsers/redboot.c b/drivers/mtd/parsers/redboot.c
index feb44a573d44..a16b42a88581 100644
--- a/drivers/mtd/parsers/redboot.c
+++ b/drivers/mtd/parsers/redboot.c
@@ -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;