]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
mtd: maps: Fix refcount leak in of_flash_probe_versatile
authorMiaoqian Lin <linmq006@gmail.com>
Mon, 23 May 2022 14:02:05 +0000 (18:02 +0400)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 17 Oct 2022 09:56:30 +0000 (11:56 +0200)
commit166e04f04c5116b51c3a9d74e8371af2af8748ec
treed86cbda1ed3d2c050c4fc3a0d0e5379eb5ad7ffa
parent1152cefb1104de3efebf7076f4e0e6f7e40ab87f
mtd: maps: Fix refcount leak in of_flash_probe_versatile

BugLink: https://bugs.launchpad.net/bugs/1990162
[ Upstream commit 33ec82a6d2b119938f26e5c8040ed5d92378eb54 ]

of_find_matching_node_and_match() 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: b0afd44bc192 ("mtd: physmap_of: add a hook for Versatile write protection")
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/20220523140205.48625-1-linmq006@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/mtd/maps/physmap-versatile.c