From patchwork Thu Nov 19 10:37:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 11917113 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4D64C2D0E4 for ; Thu, 19 Nov 2020 10:38:49 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1507524248 for ; Thu, 19 Nov 2020 10:38:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YBoBT1f2"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="F+SkgybM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1507524248 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:Message-Id:Date:Subject:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Owner; bh=GtWdpBRMBvVBnsaDDnImaZjFzn18vB5OXL1RBVWUZ58=; b=YBoBT1f2NYKGRj3gD4qFL/m5ih rRZBkI+6EJmwJQCSwBYiyrulfbEdpc7g5HeQNHEUvcG2VPfsV0SktkHsumcMQoI/tbb1+qovLGFUp 1lDHpHlx0zfvhUiZMPJIpoCYTKPA4hwz3hkqELLMN2B4hYdFWsiBhYJLBpeN3RrPCEgeDLTl3jY5E x24qJdlmrtqMHNmsoLshh/oxo4x8KoP/SgP8YbblfTUBiINCjJ2lFyftrBkjt5Kv8cjtWaG7GeO6x wzSb3v5bSFhMGy9Q8PA3MotipViMYdb0wBEmQ6+mbFA5CZi3+l877Re/f1ky8StygORokpxHJC2+N e3wD7ESQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfhKV-00008u-Vs; Thu, 19 Nov 2020 10:38:20 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfhKT-00007q-4q for linux-arm-kernel@lists.infradead.org; Thu, 19 Nov 2020 10:38:18 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201119103759euoutp0218109727a68ba1479a07de00b87e854b~I4nmwwJpu2932829328euoutp02O for ; Thu, 19 Nov 2020 10:37:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201119103759euoutp0218109727a68ba1479a07de00b87e854b~I4nmwwJpu2932829328euoutp02O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1605782279; bh=KFD0Vzmbn9PS7ku6CjqnxCRamBD3MuZZvnmwByRjSP4=; h=From:To:Cc:Subject:Date:References:From; b=F+SkgybMKLnCn0XyT7jK4/z3FNjct0NQKhdTrxg27a477pMHEMsQq4fo9PUinl1XS +0ijMYPJ+D5DLMvzvHx1LxDMVmV522FGq+nONSGh6HZFrDWSYL/kwkA7WQVJK7gjlc dtZKUCZelRp5anku5zHVVnJbOMZSRfm2/jHd+3pk= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201119103754eucas1p14d45a929127de736b36c33aa24c93884~I4nh7QPX-0640606406eucas1p11; Thu, 19 Nov 2020 10:37:54 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id E5.5C.44805.20B46BF5; Thu, 19 Nov 2020 10:37:54 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201119103753eucas1p11810b99e19d0a8477b4ca84482ab4d16~I4nhjTFWe0640606406eucas1p10; Thu, 19 Nov 2020 10:37:53 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201119103753eusmtrp19e4eedb547f76bd6bca4eaf6de5a5409~I4nhipIb31120911209eusmtrp1c; Thu, 19 Nov 2020 10:37:53 +0000 (GMT) X-AuditID: cbfec7f4-b37ff7000000af05-af-5fb64b02b3db Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 58.61.21957.10B46BF5; Thu, 19 Nov 2020 10:37:53 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201119103753eusmtip16a5caf50808dfaa470607f364b8b0f0e~I4nhB1_iS2587025870eusmtip1O; Thu, 19 Nov 2020 10:37:53 +0000 (GMT) From: Marek Szyprowski To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Georgi Djakov , Saravana Kannan Subject: [PATCH] interconnect: fix memory trashing in of_count_icc_providers() Date: Thu, 19 Nov 2020 11:37:46 +0100 Message-Id: <20201119103746.32564-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOIsWRmVeSWpSXmKPExsWy7djPc7pM3tviDTra2S02zljPajF97yY2 i02Pr7FaXN41h83ic+8RRou1R+6yWxx+085q0XXoL5sDh8eCTaUed67tYfPYvKTeo2/LKkaP z5vkAlijuGxSUnMyy1KL9O0SuDI23prMXHCKvWLD0i2MDYzb2LoYOTkkBEwkZiz/wdrFyMUh JLCCUWLv8mfsEM4XRomdr28yQzifGSX+377LCNNy+vA3JojEckaJj927mOBapq75xAxSxSZg KNH1tgtsiYjANkaJ90eSQYqYBaYAdfydxwqSEBYIkPjy6DHYWBYBVYlFE6aD2bwCthKnN1xn hlgnL7F6wwGwOyQEWjkkdu+Yyw6RcJG49+sKC4QtLPHq+BaouIzE6ck9LBANzYwSD8+tZYdw ehglLjfNgPrCWuLOuV9A93EA3aQpsX6XPkTYUeLk66usIGEJAT6JG28FQcLMQOakbdOZIcK8 Eh1tQhDVahKzjq+DW3vwwiWomz0klr3dyQRiCwnEShzdv51xAqPcLIRdCxgZVzGKp5YW56an FhvlpZbrFSfmFpfmpesl5+duYgSmhdP/jn/Zwbj81Ue9Q4xMHIyHGCU4mJVEeNdqbo0X4k1J rKxKLcqPLyrNSS0+xCjNwaIkzpu0ZU28kEB6YklqdmpqQWoRTJaJg1OqgSnZQmni04y7B35U n1n/W/ry2jU39l2baLs/KccofknCh6fH3TstMyYIftymXR1SMo05h/9zwIVv62WY9mWHF65I EWYUZkpJaK97VPxBdHKDqUaw3NwOpY1vJhjNv7FfeOvqqUp+OnJtYb2n/t2cdzJnnZPew0c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Fy1XlI3PDz80N3ip9P3FB661CbSZDv9+6Pr+x4FcO3VLFVxFNJbuyW8 vFlXsfZdeGboRL3DS5bIPJhoyOKym3OveUvYskj2ec5LmBu9753+Wu5+/t6145nf7nFv8Pz3 d7e2EktxRqKhFnNRcSIAzXFpdNACAAA= X-CMS-MailID: 20201119103753eucas1p11810b99e19d0a8477b4ca84482ab4d16 X-Msg-Generator: CA X-RootMTR: 20201119103753eucas1p11810b99e19d0a8477b4ca84482ab4d16 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201119103753eucas1p11810b99e19d0a8477b4ca84482ab4d16 References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201119_053817_333367_D5BE9469 X-CRM114-Status: GOOD ( 14.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartlomiej Zolnierkiewicz , Sylwester Nawrocki , Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org of_count_icc_providers() function uses for_each_available_child_of_node() helper to recursively check all the available nodes. This helper already properly handles child nodes' reference count, so there is no need to do it explicitely. Remove the excessive call to of_node_put(). This fixes memory trashing when CONFIG_OF_DYNAMIC is enabled (for example arm/multi_v7_defconfig). Fixes: b1d681d8d324 ("interconnect: Add sync state support") Signed-off-by: Marek Szyprowski --- drivers/interconnect/core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 974a66725d09..5ad519c9f239 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -1083,7 +1083,6 @@ static int of_count_icc_providers(struct device_node *np) count++; count += of_count_icc_providers(child); } - of_node_put(np); return count; }