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: 328398 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:5ce:0:0:0:0 with SMTP id l14csp301360ils; Thu, 19 Nov 2020 02:39:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwT+2v/CIL96ZZP/pPI09MwKjF8S6rw7ssH4mV9L7Qz+NZxdWl3TNrXCGnuoa/EIdcVjAs X-Received: by 2002:a17:906:31cb:: with SMTP id f11mr27219625ejf.142.1605782352270; Thu, 19 Nov 2020 02:39:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605782352; cv=none; d=google.com; s=arc-20160816; b=z0ndqFv5WEnOe12EkIZMn3f8V8hTYyeEdG3pch208Lw+eC43ccAO3oUvRPACH6/88E P2IeVqzUCznp+3qhxMXhI5Qy3G2tVklQFWqDxtxvmPeUDxQUfoycC41PiYDtu4yHck+c GXaf6HYcXkPT5qzGMZmRvLE3zreQJW2l4rzXuG1DmL0exDd6AbSLHzYLDXp0ncYVeE3k bbntoKRe6QR8iFG4ooD7OWXWTLTSpkvkl6/Y9GN66RVveOwcY2Vi23/1Sre6awoHiBNG 2V+CVf6WwgRNtvxytEywOSD96McvupgTRf++9kSZu/GNmDqDbWRdT2ur5UUtc+kqCb3z 7waA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:message-id:date:subject:cc :to:from:dkim-signature:dkim-filter; bh=KFD0Vzmbn9PS7ku6CjqnxCRamBD3MuZZvnmwByRjSP4=; b=jYmuZNNIbM1tOuSdJD2Wh9r8iVUiMFCnK7Pc7mtb9I6AWSPov9v/YCJwJtdwIgL/pV pddksurlcQBhCh2zFa6FjL6ra+galYW+cfiYcc5irguK9Ds2Pw28ibUoTjhbz0cNnE+H I+sw3Ee4vCpxj9ZdAJfkH8s27MZ6nqLIsQXoXfvx6VglcrZfuHfFP/05sgm7caf/a2TW 08wSB2+nY5h0c0O9ZsoxQrtYLVF99b8UvVgjzzHMieKUVCn8QHRwO4g5TBleCfAqn19F YdBkvRTfClCNfGn6TBrfr1G/BLoJqrOZqYNXZ0ucTWSHpIFYKtHWzpMs0vFmOvZTCWc9 NCNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=F+SkgybM; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp16si19736056ejc.635.2020.11.19.02.39.11; Thu, 19 Nov 2020 02:39:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=F+SkgybM; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726580AbgKSKiM (ORCPT + 8 others); Thu, 19 Nov 2020 05:38:12 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:57331 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726252AbgKSKiL (ORCPT ); Thu, 19 Nov 2020 05:38:11 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201119103759euoutp022542de3799eda3f6394f316a6324310b~I4nmwyDe82931129311euoutp02S for ; Thu, 19 Nov 2020 10:37:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201119103759euoutp022542de3799eda3f6394f316a6324310b~I4nmwyDe82931129311euoutp02S 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 Cc: Marek Szyprowski , Bartlomiej Zolnierkiewicz , Sylwester Nawrocki 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/Zwbj81Ue9Q4xMHIyHGCU4mJVEeNdqbo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qj9mNl9kX2nev//mk/4vKy/9Te4y0+7glz7EtYZ4Vf3VrndLv CM3yTVt+rP/0fIvfy56X584K19cxH93Ix7++QyuvtVxt1aKLm5V3mPtUGv3s6nM7sfPRTeWT r622ejS+XvC5NUWgarZXUPy5c6eP9h1Rfdb9ZP4Z1iiLuOWt29cYf2a2vnMsd5Ps9oJd7Grn RQ1qnk5Y4prHz6QbzFy1XlI3PDz80N3ip9P3FB661CbSZDv9+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: Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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(-) -- 2.17.1 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; }