From: Sean Wang Date: Thu, 8 Feb 2018 18:07:59 +0000 (+0800) Subject: soc: mediatek: fix the mistaken pointer accessed when subdomains are added X-Git-Tag: v4.19~1281^2~5^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73ce2ce129783813e1ebc37d2c757fe5e0fab1ef;p=platform%2Fkernel%2Flinux-rpi.git 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: 53fddb1a66dd ("soc: mediatek: reduce code duplication of scpsys_probe across all SoCs") Reported-by: Weiyi Lu Signed-off-by: Sean Wang Signed-off-by: Matthias Brugger --- diff --git a/drivers/soc/mediatek/mtk-scpsys.c b/drivers/soc/mediatek/mtk-scpsys.c index fc55faa17867..9de801e9e0e0 100644 --- a/drivers/soc/mediatek/mtk-scpsys.c +++ b/drivers/soc/mediatek/mtk-scpsys.c @@ -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))