From patchwork Thu May 26 08:17:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaoqian Lin X-Patchwork-Id: 12862090 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 2C155C433EF for ; Thu, 26 May 2022 08:19:21 +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=GKAd52YVIJfzJZNNym2YoX0hkwZtd/7lDsQg2nUp+9w=; b=jeSBqPZCWyAs/9 FEoym1/0GV+Xq1Hm66dqTYWG97tlc4lpYEMb/5q5jXywXm6FHTtxsQYs/Y5HL8j2qkaq25TkbfFkt ZpyXaSAGmR/DAhPDbzUIAKLOIDXU6hyHWIjtwYkB5te0BtwVQyw+AxjsZaAge+GoIdRNN7t1w08yV F57/YhW/mspcOtMXNTf0xgGQuWXkF2MMk3dhESaHI/1hC1qMteXVSl823ToOdUylcjPtKQey5i9jn LE8DhH24fChv/r+RUlh/kttizwmtnvB8PDNYDZSzGWmP1EqvGjAlzPOAGT7O1r5t5dtyWsfT61h6P L7P2xvAD3BMBo9gFHFcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nu8h7-00E0fV-7U; Thu, 26 May 2022 08:18:09 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nu8h3-00E0eM-3G for linux-arm-kernel@lists.infradead.org; Thu, 26 May 2022 08:18:06 +0000 Received: by mail-pg1-x529.google.com with SMTP id f4so768709pgf.4 for ; Thu, 26 May 2022 01:18:04 -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=FHMg2tAJOCenEiVm0R3x4NJY3ZvV5XmmBxrfAtuHiRM=; b=KnBx9YtN4b+GHS/KrRRe1SpvKu6kRXIFzBpZd7W9JnOP9J8tVct8iNortVjqqF14aA 7Y7r5AcJR6yBjtzcjVkTOsdqQHuPcA64ml6RkKoanCxSAnp+OL7/goCls8BaRmHAnXy6 5say0/yA7Q9/ccwhzw8oQP9Kyeiv4TnPFeSIrn6TtI9cF3ZyHFP5sKzx56q0h5NzjFh2 2KTAVj7P2agyaO4zzY30snaN0dFpM/zUBo5uxyWcNrFiXn7G4dLNeQ6xVj+mq3gl1DW4 GgGiSn+DDC0eJDqPITF/TY4ucOzgVACUNMoQxJhXhqICIOkjsNGh0UKGmmaHsBZX3ETe ZsyA== 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=FHMg2tAJOCenEiVm0R3x4NJY3ZvV5XmmBxrfAtuHiRM=; b=Ni2cSTS5Q/Eznp3NqtDsqWWUMvemrnJgRQ6Nbemq2/IkhL3qz3ci+CkaTk4tfBwY/0 RAVsbxXh0VQ8pAqSwBZty6Cf8fk39QNqWH7WsW5iuIJ0h/9EovQBJh/0Nld6vg5hVavW S+vlKK+TYdbEhONXdhCxDC8w5nqYcnircmdyyUev4Qu9qV02xz44xwQHPPFun+z1tQy3 GUknzEAFBWvzx1Q2xMLuTMQA7LEI9lFlXjNQD4JfLBfWBKVp39ppPbfaKFgZzHLfDqQ9 0Cpy1HfoVRbJjGvMwFIxFZA1LQARTUVj5KNUl8z4ojGki8Y198liCPK5AkedFQ30Zk5B Ya+w== X-Gm-Message-State: AOAM530QzAlbwaXNoQn/XXK9u0ctdtWWrvA2MOQ7/H3dqjLAyFshVUDo N++wWLJy0u3iyniST7ja2p16uCpBClUNGjut X-Google-Smtp-Source: ABdhPJwa3Ta0ib9PrN7P+QnvubHC3BGs+cfN2XyBZuN/FssHGW+YpSwHz7QhClmqcA8h5g9+B09wPg== X-Received: by 2002:a65:5188:0:b0:3fa:6081:7393 with SMTP id h8-20020a655188000000b003fa60817393mr15297881pgq.72.1653553083916; Thu, 26 May 2022 01:18:03 -0700 (PDT) Received: from localhost.localdomain ([202.120.234.246]) by smtp.googlemail.com with ESMTPSA id u2-20020a17090ae00200b001dcf9fe5cddsm827824pjy.38.2022.05.26.01.18.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 01:18:03 -0700 (PDT) From: Miaoqian Lin To: Linus Walleij , Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: linmq006@gmail.com Subject: [PATCH] ARM: integrator: Fix refcount leak in intcp_init_of Date: Thu, 26 May 2022 12:17:56 +0400 Message-Id: <20220526081756.32998-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-20220526_011805_174920_BC8C7397 X-CRM114-Status: GOOD ( 11.99 ) 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: df36680f1a71 ("ARM: integrator: core module registers from compatible strings") Signed-off-by: Miaoqian Lin --- arch/arm/mach-integrator/integrator_cp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index b7eb4038798b..bb301ca8c7e1 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c @@ -126,6 +126,7 @@ static void __init intcp_init_of(void) return; intcp_con_base = of_iomap(cpcon, 0); + of_node_put(cpcon); if (!intcp_con_base) return;