Received: by 10.223.185.116 with SMTP id b49csp5958126wrg; Wed, 7 Mar 2018 22:39:02 -0800 (PST) X-Google-Smtp-Source: AG47ELv9K9Es/sXr8KAJWDLlFC773v1W2odttGL34iVGAgBVCbW0421tcsDZHmlBnaleYUQQFzTu X-Received: by 10.99.117.89 with SMTP id f25mr19953994pgn.18.1520491142555; Wed, 07 Mar 2018 22:39:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520491142; cv=none; d=google.com; s=arc-20160816; b=KTpN5rYinKsug8dXXsfuEAfPZMaT6gx9lM07P+0BM1yacE/F/zNFFWaP4gEeb6eAqb JlR7qjWDY0b8NFbhl/nwwxa85zceKL9Syh4J0c/S/zGI9rBCdjazyLi83K8o9VtPTDRc lloBH5vNDw1K2ks7lYq2IK7S5/7kPM7vPqqvA//lBx1PC4gL+il1/fSu1NaIUHydm7/o DDok5d2p2RhGBxkxlu5cNU9JqQaF9TreDats0Mwq/QD4GXiv49MLudN7vlWoM8H4mil0 iRTOsPEHsLrTTD2T5CkjtxfbYdY/7Tp0oUy0/2h+x2Xv0ztWwmW0hrygyw/Vk3pdWSd7 2iCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=JkwXXT01fCRVqcDRBhgGnSoYC2nPxFJbNukPLwlkyjg=; b=f/AsqT/37s9taOKuZeXmDxlszyWKCz1dlYEhqCUZOMlkF1XT7yeLn7IIW6BEG48JXc 2ozBGUaustMg4daUczITql3FnowZhmLKZCl87GAb2OOsr9XkRrmhbW1YQ7WWfAlIn5rZ qGGIz5ZwZ/D5knzm3OUqwSH3KsaHX18ccTrxROCSt/hJcLe0FOsqZcFscWdaOiy7rm03 L6Qe6c6+MKKhBGSH64jBez+ezNZop4xv6zi755XunSh4n8suRUBsUqniVl0TSSq8QwYl yaOw1AnFygIlHU4DURnHkmqGrCyOq6ITxHe06pqK1wvrThEyJmyavQeIPNrvkjvNK+4O y86g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Mg/4mTUC; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si12359173pgt.572.2018.03.07.22.38.48; Wed, 07 Mar 2018 22:39:02 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Mg/4mTUC; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755569AbeCHGhh (ORCPT + 99 others); Thu, 8 Mar 2018 01:37:37 -0500 Received: from mail-co1nam03on0126.outbound.protection.outlook.com ([104.47.40.126]:14720 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965341AbeCHE7O (ORCPT ); Wed, 7 Mar 2018 23:59:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=JkwXXT01fCRVqcDRBhgGnSoYC2nPxFJbNukPLwlkyjg=; b=Mg/4mTUCQDCSpmKYIHtL53W5Z8kNd9QcXyjeBshq+aAqqcKq9InlpUR4jsfVGT9BHcl+sgJEw0+X9aE5R31l1TFAt/WnhK9pvajfvq3AoP39PNqtpdU3Yi01pm2w1yjDd91XWtpSXgxN2sdikE+cAfqMlPZiH7LSOwt4+NKqHBk= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0999.namprd21.prod.outlook.com (52.132.133.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.588.7; Thu, 8 Mar 2018 04:59:11 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0588.008; Thu, 8 Mar 2018 04:59:11 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Johan Hovold , Bjorn Andersson , Rob Clark , Andy Gross , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 56/67] soc: qcom: smsm: fix child-node lookup Thread-Topic: [PATCH AUTOSEL for 4.14 56/67] soc: qcom: smsm: fix child-node lookup Thread-Index: AQHTtpoFMsEwNkQ8n0yM3wRpkauhSg== Date: Thu, 8 Mar 2018 04:57:56 +0000 Message-ID: <20180308045641.7814-56-alexander.levin@microsoft.com> References: <20180308045641.7814-1-alexander.levin@microsoft.com> In-Reply-To: <20180308045641.7814-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0999;7:Ru3FyBvnZ+dnM/27lpG1cL4S9sq8MV8Qbzlgn6B7jDOMsoW10ZV1soOT1c0iKPjXTM8d54dk6hFEcgrdbbyeUdJQKaaRwMDeGfzGcucymPsQyit/cMFtPTa5zdFUY/TwGbK94zPefNlyew1Zl29KJdq0W5doa7c+y2422xNUJr27vjZ/leBev60VwbNRA4SYw7/wRRlP6CfL7PHa9vi0mBJvQ8mXs0P99lB+4vPE6VYl81LqAVqpqJoUvPE7yZzP;20:YjfTqX/y7JfV6eWuvR2StfUJgkKwZKHwQgxZrQol9jT3B5zyAXmuZHUJSWJCHt8F+XclPA8jgqVl/hmy4TpscLTlBdZF2VDigSm4kDWKRaPfs9Y+QXfbU8eO6X3oBhU3rIHIfB0t1j10aJBCjJipycr6JOyFs38NBAMs9pPMijw= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 12481e0f-bb21-4390-fc88-08d584b154d8 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0999; x-ms-traffictypediagnostic: DM5PR2101MB0999: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231220)(944501244)(52105095)(6055026)(61426038)(61427038)(6041288)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB0999;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0999; x-forefront-prvs: 060503E79B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(39860400002)(39380400002)(376002)(396003)(346002)(189003)(199004)(72206003)(3846002)(106356001)(8676002)(6116002)(1076002)(6512007)(14454004)(81156014)(66066001)(2906002)(3660700001)(478600001)(10290500003)(8936002)(6486002)(305945005)(7736002)(36756003)(2900100001)(81166006)(4326008)(25786009)(6436002)(5250100002)(105586002)(54906003)(22452003)(76176011)(5660300001)(10090500001)(110136005)(316002)(39060400002)(6506007)(86362001)(186003)(2950100002)(97736004)(3280700002)(102836004)(99286004)(107886003)(68736007)(86612001)(53936002)(26005)(6666003)(2501003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0999;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: rrNzgP0qvWKNlpfXatLAMNDqqmppNgSugWr3Wcgt8xw3K5e+ChzdMLvkzcJFnOYimrRotMFIF448OCBy9WxlQpzGHKxwK+mMp54VghuVp+RoYLMqO6poat4wJhmd1muwpzFGAXEETN+4stBoa4OaOxT1u/y60pw2QFwVW/BaWl1l+lyC6P8gLAM/eM1FCokbpyHHg8CVLyOIyV/fsyIr3VPTGCNUEXZtIoU8vwGLT1L1a+yCm623QSv4qwDxeAryTrx8I/r8wFIUHk7bq3/qKavmpVVzZnwmSPGAqBZYN3IwTdFrrznMY9c7c04+vn6G1JXnC/MmjJlYKPLndw4HNQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 12481e0f-bb21-4390-fc88-08d584b154d8 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2018 04:57:56.4072 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0999 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold [ Upstream commit 8804517e9fc16c10081ff5e42e7d80704973a8e2 ] Fix child-node lookup during probe, which ended up searching the whole device tree depth-first starting at the parent rather than just matching on its children. Note that the original premature free of the parent node has already been fixed separately. Also note that this pattern of looking up the first child node with a given property is rare enough that a generic helper is probably not warranted. Fixes: c97c4090ff72 ("soc: qcom: smsm: Add driver for Qualcomm SMSM") Fixes: 3e8b55411468 ("soc: qcom: smsm: fix of_node refcnting problem") Cc: Bjorn Andersson Cc: Rob Clark Signed-off-by: Johan Hovold Reviewed-by: Bjorn Andersson Signed-off-by: Andy Gross Signed-off-by: Sasha Levin --- drivers/soc/qcom/smsm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/smsm.c b/drivers/soc/qcom/smsm.c index 403bea9d546b..50214b620865 100644 --- a/drivers/soc/qcom/smsm.c +++ b/drivers/soc/qcom/smsm.c @@ -496,8 +496,10 @@ static int qcom_smsm_probe(struct platform_device *pde= v) if (!smsm->hosts) return -ENOMEM; =20 - local_node =3D of_find_node_with_property(of_node_get(pdev->dev.of_node), - "#qcom,smem-state-cells"); + for_each_child_of_node(pdev->dev.of_node, local_node) { + if (of_find_property(local_node, "#qcom,smem-state-cells", NULL)) + break; + } if (!local_node) { dev_err(&pdev->dev, "no state entry\n"); return -EINVAL; --=20 2.14.1