From patchwork Sun Jun 5 08:48:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaoqian Lin X-Patchwork-Id: 12869736 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41DB3C433EF for ; Sun, 5 Jun 2022 08:50:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=EpjgegYyCcMDwFMTIQoHTbXFl8eaVrnhdcOM8an4tL8=; b=pc8qnif1cp8Z+F Mo+zDQKUwFTDenbOrZaAI0vi3wX11USFslTLGUFy5nb2XBsCcRkD7Hv7jImhCeTqjcks2TjZPT12H qWth5U8uz+pT2DHJ65if+ZqPIlIGEbX++8iGwWZ1LjLMxV7Aeuo353c9PAaLDVgA+ndqk7xP94tga HSQDp2TvcsZvXDpTV8q6hyflWJfQfl+YlnOEBaNYEUpegp7rBpAMqj8MIyE/+/KXjMJ8vUxzEyov+ GBPL3GbocwY37n6jQytW/71tKeTJYaaA98bK5KYiyN3srjOkPnafegy7JRHx+gxUEkWtBvMhMpH8t t+K1sgTZ3wc++XQG5ujQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxlwc-00E3ks-FL; Sun, 05 Jun 2022 08:49:10 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxlwW-00E3k5-89 for linux-arm-kernel@lists.infradead.org; Sun, 05 Jun 2022 08:49:08 +0000 Received: by mail-pj1-x102f.google.com with SMTP id l7-20020a17090aaa8700b001dd1a5b9965so10320745pjq.2 for ; Sun, 05 Jun 2022 01:49:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=f2zpvH+KVD/8jHsV0ASeB9VNDeynxoyrvxGNU6QM330=; b=eg+LMOs8KRy3SKWUqYqmF3UmIcozRovoZonPV3hqBETWIWunZJOM6IvuWQIndQO2Ha XZOFkRzp+HbcJd6H6vu+JYmnAw9PchYBWA0nVZWdTan05OGTWYxZYv8sXz0IEA9Yz1Dl 3x6futirJa+lG7de+zUXeAunI1zClMmuvg/u4C2BgE5fshGq+WxQBHI6E6bWlqDQhm+B GLPs71TLsoihULrY5CrEPNNwYsK6dtmNksLjT3plRDgw+xtLtNQyonNXCDDKhIkarfsS x8GH7ryQz9n337B7dUPzFzFUWGIUEL8iw8d1LCSq0OLv97raR0c9GjqInI2HoFpDAqfo hi7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=f2zpvH+KVD/8jHsV0ASeB9VNDeynxoyrvxGNU6QM330=; b=k5CHPKJFU6oEYHMsbvEGxlfoPuWdb64rqhZ7uaFkTkC9ZrQ7Xpnam1povgpEyilrcu q3OoPuKHJrn6Lu9Jaauh9wCv3/qeygTSBBDgAH7zF9SNY/iAwkPZTf+GzVerYbF7rWxj rn4UdCpS4EPqepoLr0K1i+RdIU8Si5bl3ksOV+Wx2ngI/iah1cttZWf+itToaeHswkwO lto8dgxhZYAsHXV6qlxLHdwAA6AoFuRoDrsBDcVrtRfCJwJLoS6hvGwPHqM2Wo8LGXkU A82WaL7Ql+hprrAeqlV9JoRwf0tFB79mVTeuNjPpM/4EmC5Aysig/+44YmafgfFSQ1lz aFTQ== X-Gm-Message-State: AOAM531kptfOzUilfdwZ9tCqg+DlRE6kyaQ2hVOhQtv++2ozzWAuPOG8 lFMAVc4SOQhVPh0X38QhC6s= X-Google-Smtp-Source: ABdhPJy1zI5Cef0GS97dq7Q+aUXs+4F80remtmuxSShzQbOqk2+Dvm2wCo2XpimuxEfS3BRHmDALow== X-Received: by 2002:a17:90a:c202:b0:1e2:e772:5f0a with SMTP id e2-20020a17090ac20200b001e2e7725f0amr20144538pjt.109.1654418942672; Sun, 05 Jun 2022 01:49:02 -0700 (PDT) Received: from localhost.localdomain ([202.120.234.246]) by smtp.googlemail.com with ESMTPSA id y188-20020a6232c5000000b0051bb79437f7sm8271867pfy.37.2022.06.05.01.48.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 01:49:02 -0700 (PDT) From: Miaoqian Lin To: Linus Walleij , Russell King , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: linmq006@gmail.com Subject: [PATCH] ARM: versatile: Fix refcount leak in ap_init_of Date: Sun, 5 Jun 2022 12:48:54 +0400 Message-Id: <20220605084854.29659-1-linmq006@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220605_014904_328286_7001E36B X-CRM114-Status: GOOD ( 12.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org of_find_matching_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: e67ae6be734d ("ARM: integrator: hook the AP into the SoC bus") Fixes: df36680f1a71 ("ARM: integrator: core module registers from compatible strings") Signed-off-by: Miaoqian Lin --- arch/arm/mach-versatile/integrator_ap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-versatile/integrator_ap.c b/arch/arm/mach-versatile/integrator_ap.c index e216fac917d0..6b2a69acc6b0 100644 --- a/arch/arm/mach-versatile/integrator_ap.c +++ b/arch/arm/mach-versatile/integrator_ap.c @@ -175,6 +175,7 @@ static void __init ap_init_of(void) if (!syscon) return; ap_syscon_map = syscon_node_to_regmap(syscon); + of_node_put(syscon); if (IS_ERR(ap_syscon_map)) { pr_crit("could not find Integrator/AP system controller\n"); return;