]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pmdomain: imx: Fix reference count leak in imx_gpc_probe()
authorWentao Liang <vulab@iscas.ac.cn>
Thu, 11 Dec 2025 04:02:52 +0000 (04:02 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:14:49 +0000 (10:14 +0100)
commita4a4599b9164a646a7e4a85d564900591b1b84eb
treea6db0d198cbba584eeda638fb9dac7e82fb9a2a1
parent365cd49669a681049dcf143d5dc1e2c26a610060
pmdomain: imx: Fix reference count leak in imx_gpc_probe()

commit 73cb5f6eafb0ac7aea8cdeb8ff12981aa741d8fb upstream.

of_get_child_by_name() returns a node pointer with refcount incremented.
Use the __free() attribute to manage the pgc_node reference, ensuring
automatic of_node_put() cleanup when pgc_node goes out of scope.

This eliminates the need for explicit error handling paths and avoids
reference count leaks.

Fixes: 721cabf6c660 ("soc: imx: move PGC handling to a new GPC driver")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pmdomain/imx/gpc.c