Commit 77dc7f98 authored by Peng Fan's avatar Peng Fan Committed by Yongqiang Liu
Browse files

pmdomain: imx93-blk-ctrl: correct remove path

stable inclusion
from stable-v6.6.63
commit 8fc228ab5d38a026eae7183a5f74a4fac43d9b6a
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB956J
CVE: CVE-2024-53134

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8fc228ab5d38a026eae7183a5f74a4fac43d9b6a



--------------------------------

commit f7c7c5aa556378a2c8da72c1f7f238b6648f95fb upstream.

The check condition should be 'i < bc->onecell_data.num_domains', not
'bc->onecell_data.num_domains' which will make the look never finish
and cause kernel panic.

Also disable runtime to address
"imx93-blk-ctrl 4ac10000.system-controller: Unbalanced pm_runtime_enable!"

Fixes: e9aa77d4 ("soc: imx: add i.MX93 media blk ctrl driver")
Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
Reviewed-by: default avatarStefan Wahren <wahrenst@gmx.net>
Cc: stable@vger.kernel.org
Message-ID: <20241101101252.1448466-1-peng.fan@oss.nxp.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarRui Xiang <rui.xiang@huawei.com>
Reviewed-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent 5f2e6940
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -313,7 +313,9 @@ static int imx93_blk_ctrl_remove(struct platform_device *pdev)

	of_genpd_del_provider(pdev->dev.of_node);

	for (i = 0; bc->onecell_data.num_domains; i++) {
	pm_runtime_disable(&pdev->dev);

	for (i = 0; i < bc->onecell_data.num_domains; i++) {
		struct imx93_blk_ctrl_domain *domain = &bc->domains[i];

		pm_genpd_remove(&domain->genpd);