]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
soc: mediatek: fix the mistaken pointer accessed when subdomains are added
authorSean Wang <sean.wang@mediatek.com>
Thu, 8 Feb 2018 18:07:59 +0000 (02:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Apr 2018 07:36:28 +0000 (09:36 +0200)
commit 73ce2ce129783813e1ebc37d2c757fe5e0fab1ef upstream.

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 <weiyi.lu@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/soc/mediatek/mtk-scpsys.c

index e1ce8b1b5090aa0a7b91b6abcd73ad7fa0760261..fb2a8b1e7979169c74d56badcb296fe774938ae8 100644 (file)
@@ -892,7 +892,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))