]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: sdhci-of-esdhc: Fix refcount leak in esdhc_signal_voltage_switch
authorMiaoqian Lin <linmq006@gmail.com>
Mon, 23 May 2022 14:42:54 +0000 (18:42 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:50 +0000 (14:23 +0200)
commitfd216c9ddd95cdf74ccd24ee93e97cb5f3dd26a6
treeb0597554c8ad363bbff25da5313e13796c32bf93
parent488ab3f9bc01b2c12a0789cc0ec7e16287d24498
mmc: sdhci-of-esdhc: Fix refcount leak in esdhc_signal_voltage_switch

[ Upstream commit 918c38069a680d20018e2b8423db4690046e681c ]

of_find_matching_node() 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.
of_node_put() checks null pointer.

Fixes: 75ac19c92f67 ("mmc: sdhci-of-esdhc: add support for signal voltage switch")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220523144255.10310-1-linmq006@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mmc/host/sdhci-of-esdhc.c