]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: parsers: ofpart: Fix refcount leak in bcm4908_partitions_fw_offset
authorMiaoqian Lin <linmq006@gmail.com>
Sun, 5 Jun 2022 07:07:23 +0000 (11:07 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:41 +0000 (14:23 +0200)
commit76be495660a676c268433b4c2c46346114fd7241
tree26d3acc4b3cea83c5b81b7e91abb2cf4e8694118
parent7885386372603e4b5ac14765b6206142f72a14f7
mtd: parsers: ofpart: Fix refcount leak in bcm4908_partitions_fw_offset

[ Upstream commit 93860ba81ec7b2b5835a4e9c9e46eb9f5873dfc4 ]

of_find_node_by_path() 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: 4fae4be93fb1 ("mtd: parsers: ofpart: support BCM4908 fixed partitions")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220605070726.5979-1-linmq006@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mtd/parsers/ofpart_bcm4908.c