Commit bbde1468 authored by Miaoqian Lin's avatar Miaoqian Lin Committed by Ulf Hansson
Browse files

pmdomain: imx: Fix reference count leak in imx_gpc_remove



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: 721cabf6 ("soc: imx: move PGC handling to a new GPC driver")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent fccac54b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -536,6 +536,8 @@ static void imx_gpc_remove(struct platform_device *pdev)
			return;
		}
	}

	of_node_put(pgc_node);
}

static struct platform_driver imx_gpc_driver = {