]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: partitions: Fix refcount leak in parse_redboot_of
authorMiaoqian Lin <linmq006@gmail.com>
Thu, 26 May 2022 11:06:49 +0000 (15:06 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:41 +0000 (14:23 +0200)
commit7885386372603e4b5ac14765b6206142f72a14f7
tree8d13568283ba306f41edb4a216a2eb2392b3d5a5
parentb608b8c14ec62e0a8eb8baa53f13918df97963d0
mtd: partitions: Fix refcount leak in parse_redboot_of

[ Upstream commit 9f7825a193035127e3d4e7138cee4bffbec471a1 ]

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: f0e4c7650b8f ("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>
drivers/mtd/parsers/redboot.c