Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2910617iog; Mon, 27 Jun 2022 05:35:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vljHrTTDHyI8tUsws2wo1yml7GjR+yI5A3HXh5RGkhjZc2q9hcFm9S7R6dZsyg7y5ttFyP X-Received: by 2002:a17:907:7f05:b0:726:9770:77d6 with SMTP id qf5-20020a1709077f0500b00726977077d6mr7790531ejc.464.1656333326916; Mon, 27 Jun 2022 05:35:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333326; cv=none; d=google.com; s=arc-20160816; b=UjosaOWbcWySpNJ0+FLfD0sOlvFXtkwg/sSU/Za89nG23wBTS9bP25WhtRhUesLQl/ qlF4OHJGQrrCf3x+MlFKSP7FXUkFGVpxwHhU3OfjXKtd+xC4E3iYHcMG9bU/stz3YkiM FXtXTsiXNCN8+kv3nuVdDVDrvjYn83T+xL/Utqf+HHXY9imQah/G6qi+Ji+uQGHiOEC9 csRPXtTJnk9+JE/pz5yztOvOV4M7E3qgtiq9orCo3K99bom6thnzcINhUemo4dbz9Gb/ JeIdoQQWzA+P/kVk0kgOjm/J9UizNa1lDKpGdCGA/oytBYszK3yC9fKEMtzso1gHW+EI 0hEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qYl9e0B22vU3L34ClwfK+uxUAYZ4zFxP27Fq3QRKLMY=; b=CzoYvs3Cu8fOOxZlQhJxe5QK1EkvKu6Jba9mAi8kG6SiS4tY4XUTCgB9/MeSLw4Txg 3+zVuqFnuewB7PFq8TzypDoffNEa1BT8jpx6bpswIRpd7QW0Fl+3Lo1tPkjZiFAMYa8t 9F4+EwiXpw9ihUaJqgYtAT5nq18X3JHrUye493h5N61LlLH4xx89f1LnR1YzmYK5wdno 5XzMHMXywKFty2LN6wzTLLhxvwqUIt3+WfwsEE3zFx6OeXMRJ6ztGRywZ+nnArsjgUXk jgQJzh9OeGTl8FxlyAbAnuY7KIkUDqsq5qyEici1d2+eF713CUqeffm/Mc2lBpvjVQXG IBfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oFNIx3j6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw19-20020a170906479300b007123952b00dsi13218607ejc.100.2022.06.27.05.34.55; Mon, 27 Jun 2022 05:35:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oFNIx3j6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235780AbiF0Lfr (ORCPT + 99 others); Mon, 27 Jun 2022 07:35:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236360AbiF0Ldl (ORCPT ); Mon, 27 Jun 2022 07:33:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2815AB3F; Mon, 27 Jun 2022 04:31:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7ED88B8111B; Mon, 27 Jun 2022 11:31:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3046C3411D; Mon, 27 Jun 2022 11:30:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329459; bh=Uhr76rKpMn9k14Rt8kwoPSjAeauo8B0/oEPeKfxRQSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oFNIx3j6mBiNHySsPQQbxRCRHtlAXtXoh9zsb/iNWJhnaQT2rR2xTQUAJo2D7bzjp uAh8iQaz14WV9SyQquTdFW05LUaXLuA2sZ7LfqB5zdW6FE8GsgxmHXFbHQmwkY4Els VIiUXdCbFnEI6r3f4uEHUHQy0USxIuljpoMkczY0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Krzysztof Kozlowski Subject: [PATCH 5.4 53/60] ARM: exynos: Fix refcount leak in exynos_map_pmu Date: Mon, 27 Jun 2022 13:22:04 +0200 Message-Id: <20220627111929.250837330@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin commit c4c79525042a4a7df96b73477feaf232fe44ae81 upstream. 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. of_node_put() checks null pointer. Fixes: fce9e5bb2526 ("ARM: EXYNOS: Add support for mapping PMU base address via DT") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220523145513.12341-1-linmq006@gmail.com Signed-off-by: Krzysztof Kozlowski Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-exynos/exynos.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -136,6 +136,7 @@ static void exynos_map_pmu(void) np = of_find_matching_node(NULL, exynos_dt_pmu_match); if (np) pmu_base_addr = of_iomap(np, 0); + of_node_put(np); } static void __init exynos_init_irq(void)