Received: by 10.192.165.148 with SMTP id m20csp2537424imm; Sun, 22 Apr 2018 09:06:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/DtJSXfa6p/AcJ2XYnGiHmSWTvbzFwFJyKKQQDRNF3wpBvAOI/5HBmM+YSOBP/Rd5Qj6ko X-Received: by 2002:a17:902:2927:: with SMTP id g36-v6mr14832021plb.303.1524413160440; Sun, 22 Apr 2018 09:06:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524413160; cv=none; d=google.com; s=arc-20160816; b=FCkCZeqYLi960i3eEWJtLpxLMDemHkXSOLUGUg1WeDUWryhqjpjF1I0CF8ttoc3bYb zapVQ6ZIjhddsfCrGvp1JQcpkjwfnrpKBNwVm1+3Focuz3To7Po5NEqJbb5NJ1PsZTbS YCMxFAtyVvCplSZeLU4mhd9v7Jz0M2W4GS4HF+1MBHWA/GsOx79oLVsRJ8AYCbPkfPCi Gf/2ygE1linTQfwLMCoDQMUQzYQoQXmHm/JDW2nXcRmKvXF0a/n16qPuN9eyNAaLfgH4 H1IeSZ84AHj0tApNvgOSl7dqMpeo71NgkpvT+wdD119vUFBfKgksiZbfficDwGxtR3eM pmlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=31SyK8DStvKR3/refgMSlnF+EiAj30YG2mex8/ZiAzo=; b=QnB+xY6lXlhvryz+4JM3Yl6nSuUeDcuIy7C/c7lqxMGNk47/rLzRkMqXUaiLvU7BOM DcYmbWtsRlj4voNbLVdmqjGBi/u/K8c0XwTI6zUhnL7vttMQaNkKFBk7RZPEXNl21V7C Huaw+PDFngKmix+pzi/jerYnt2WyrmzLHqj541K+/vxmQ1TsLkzZCGE4AQ9r76y6X2Wl CU4wJCjL39izFYVl+1fE5lsKAVlJQ/Bayx1AHZeps71QGM//OU7x49C0S8M7BBUVMoxX KXDQlfoZ0btUlSKteOH5VVXntiKFVps9qvZfVqkybUDnRNV+hP2PrKBljJm8ogjIKGcr eKyA== 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 n3-v6si9829870plb.147.2018.04.22.09.05.45; Sun, 22 Apr 2018 09:06:00 -0700 (PDT) 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 S1754117AbeDVQEp (ORCPT + 99 others); Sun, 22 Apr 2018 12:04:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45812 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753986AbeDVN5g (ORCPT ); Sun, 22 Apr 2018 09:57:36 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0A4DCCD8; Sun, 22 Apr 2018 13:57:35 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Weiyi Lu , Sean Wang , Matthias Brugger Subject: [PATCH 4.16 072/196] soc: mediatek: fix the mistaken pointer accessed when subdomains are added Date: Sun, 22 Apr 2018 15:51:32 +0200 Message-Id: <20180422135107.975343300@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sean Wang 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 Signed-off-by: Sean Wang Signed-off-by: Matthias Brugger Signed-off-by: Greg Kroah-Hartman --- drivers/soc/mediatek/mtk-scpsys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/soc/mediatek/mtk-scpsys.c +++ b/drivers/soc/mediatek/mtk-scpsys.c @@ -992,7 +992,7 @@ static int scpsys_probe(struct platform_ 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))