Commit 73ce2ce1 authored by Sean Wang's avatar Sean Wang Committed by Matthias Brugger
Browse files

soc: mediatek: fix the mistaken pointer accessed when subdomains are added



Fix the pointer to struct scp_subdomian not being moved forward
when each sub-domain is expected to be iteratively added through
pm_genpd_add_subdomain call.

Cc: stable@vger.kernel.org
Fixes: 53fddb1a ("soc: mediatek: reduce code duplication of scpsys_probe across all SoCs")
Reported-by: default avatarWeiyi Lu <weiyi.lu@mediatek.com>
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
parent c932ba8c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1048,7 +1048,7 @@ static int scpsys_probe(struct platform_device *pdev)

	pd_data = &scp->pd_data;

	for (i = 0, sd = soc->subdomains ; i < soc->num_subdomains ; i++) {
	for (i = 0, sd = soc->subdomains; i < soc->num_subdomains; i++, sd++) {
		ret = pm_genpd_add_subdomain(pd_data->domains[sd->origin],
					     pd_data->domains[sd->subdomain]);
		if (ret && IS_ENABLED(CONFIG_PM))