pmdomain: imx: Fix reference count leak in imx_gpc_remove

[ Upstream commit bbde14682eba21d86f5f3d6fe2d371b1f97f1e61 ]

of_get_child_by_name() returns a node pointer with refcount incremented, we
should use of_node_put() on it when not needed anymore. Add the missing
of_node_put() to avoid refcount leak.

Fixes: 721cabf6c6 ("soc: imx: move PGC handling to a new GPC driver")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
[ drivers/pmdomain/imx/gpc.c -> drivers/soc/imx/gpc.c ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Miaoqian Lin 2025-11-21 12:15:53 -05:00 • committed by Greg Kroah-Hartman
commit e45dfc5368

View file

@ -540,6 +540,8 @@ static int imx_gpc_remove(struct platform_device *pdev)
return ret;
}
of_node_put(pgc_node);
return 0;
}