Received: by 10.223.176.5 with SMTP id f5csp2210272wra; Thu, 8 Feb 2018 10:09:04 -0800 (PST) X-Google-Smtp-Source: AH8x226pRSUQ1idUKG6lg3sHqhjlhDSUqgGz1IWbjZBx1qSijq6xiTFp29WIZmKE31QvrwiYyMoL X-Received: by 2002:a17:902:1e5:: with SMTP id b92-v6mr5492plb.144.1518113344180; Thu, 08 Feb 2018 10:09:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518113344; cv=none; d=google.com; s=arc-20160816; b=Xt1YLQUgPgUdDdazljIhvHWY5YZh+dWEFT5FVFPqv4bQP1DDMjcoRxAmKbc9BTQnCQ 0sGVhsX8GOoZBTeZhx3g33cWdPEUayDsKHWl/xKW8glSUaDSG6CrQYi9LxrvxI5v3q6+ g02YkzwWjSmyMBBGcO75gOywd2GWtCLkXJgbBgHeJJhVSB42jDBtlQvgE/grTAngAwqj Xu/Z5TDLKNqGPNMuoJQG5MXXzwwvrzG5v0HzgMdUBVMsLeoI9DrB2h3XO7k9AxXJ7sZ4 pUQWoUsNy7z4ao7eyws6IEUV2uWu8A1Wi2ystNeY3F61M8qxaW6hHG9ldgtLg13g2p4d KGCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=Y59DRUc03PgUzFSxeDaB752DARhz19CWR62HGeqMp8M=; b=aw1dqM1K2TzmQWREe7t1rbLpC5SN8pV0zVoJyZmmHkCtRbZ4EsXiFBNMMO9y45MT/C sAJZh9WnLaBKlSUWLQpWLvBEdw7/sfLpyWYN8c1HGN2IKbs3v66M27Czs8kwjwMdHr3a MfBLMIiRKMuzPnt98fGPG6VzyQDAwJuV3/s2SaTxjgN8P13CG3+2qmCx4ps9Ra8OvLlv fSwicyEXL/C/kCzDijOkgzsjUiJWFuqmX4OY/3IePzJctTulHeE4/Y7uURxjyRqGmUpu KzfYHOcLFUg57z22U7gIKEVDaHME8lBDo4Ew0zRYdAGcKL+z70sQUUCGNv/3QZC7YUXO bkUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e93-v6si272972plk.580.2018.02.08.10.08.48; Thu, 08 Feb 2018 10:09:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752176AbeBHSIH (ORCPT + 99 others); Thu, 8 Feb 2018 13:08:07 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:45998 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751544AbeBHSIG (ORCPT ); Thu, 8 Feb 2018 13:08:06 -0500 X-UUID: 10b7d4d3e9084c0280190d5142981d07-20180209 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 905208135; Fri, 09 Feb 2018 02:08:02 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Fri, 9 Feb 2018 02:08:01 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Fri, 9 Feb 2018 02:08:01 +0800 From: To: , , CC: , , , , , Sean Wang , Subject: [PATCH] soc: mediatek: fix the mistaken pointer accessed when subdomains are added Date: Fri, 9 Feb 2018 02:07:59 +0800 Message-ID: <9d9d75250bf62b491294a0c550c35ab7aba05eef.1518113047.git.sean.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang 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 --- drivers/soc/mediatek/mtk-scpsys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/mediatek/mtk-scpsys.c b/drivers/soc/mediatek/mtk-scpsys.c index fc55faa..9de801e 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)) -- 2.7.4