Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2910383iog; Mon, 27 Jun 2022 05:35:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v9WNVJQW+OBLqcCmGE4EsdrmCJXaeR1YoUv81mfWzHJOPLZx1dClvS6ehn4cYQ2+J/95VW X-Received: by 2002:a17:907:6e26:b0:726:97af:9846 with SMTP id sd38-20020a1709076e2600b0072697af9846mr7757360ejc.300.1656333309001; Mon, 27 Jun 2022 05:35:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333308; cv=none; d=google.com; s=arc-20160816; b=U1tBxyEjUjSJHb8kihCqKucz8/YDUcOUF63PXtUaxohet0tKci4e48fLlaTxMscReY epS9ED2yV6/P+f4ZWNDKKgP8voUtweRJpClshwJl0wV74DJYp8z16hALmlhed/NnLMvj QV0Blti8dBTX71ZO6YRTYPRpJn7vhFbQdnUPSY+3CpN63NzR6KF6suEFKsuhGnLRTtdI +pX4LBIOd3Twz5yROqOTa+YszxUm64KgNUPz62cU/z3cTMOQR+1/KOjCUaL67zZgoH/Q D0amdPsXR89q/I2a8abrZD8WYBgaGJAll4wQLRPke0RVN+SgULTQXpl20bUGRx0swb9q 0GGw== 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=UT2g7ZNHJPbbqwYBdRdSfxWwdcRdfNIQBzEF1qBSqes=; b=tHtWAKyg/w1Lfr+VOvjzLiIDA4IMRd/8iMCCHYGi6LJZ3gq78eIA2IAzrPBMvvdZm5 v7rM/2RcUDaORTk0UvKe9jaHxhMd/osRhREJEjFK0tyj4W1uNA3y6vTQttioD4qHXqYU F+VxpW4g1Qlvf0LyBEDBgBYYzxQLEDi467G3tAXK4AFfQakHEK7TbvlBMFN/pa2Zg8ou lmgPoRtdEGOxVDZhqIywoLXZ0z0eiMjdQgh8dElN+9+pcT9FSHIzunuaW88tnqHkR+sS EBoFTJeKxUw1WJJ/7rYkwuXxfWGE91+WIQ5sOY13ZUbXU8geph+z7SVxptYymBzoicmE DjNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OJRY1j2l; 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 bm11-20020a170906c04b00b00715785bb696si468653ejb.447.2022.06.27.05.34.44; Mon, 27 Jun 2022 05:35:08 -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=OJRY1j2l; 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 S239424AbiF0L7r (ORCPT + 99 others); Mon, 27 Jun 2022 07:59:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238817AbiF0Lwk (ORCPT ); Mon, 27 Jun 2022 07:52:40 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CBA3DEB1; Mon, 27 Jun 2022 04:45:50 -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 sin.source.kernel.org (Postfix) with ESMTPS id A22B2CE171A; Mon, 27 Jun 2022 11:45:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91BBAC3411D; Mon, 27 Jun 2022 11:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656330346; bh=WZXy+Bd4DgG1VVzSNOzT8zUIRZ/5VvEGPPSlCWy6ceA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OJRY1j2lVU8ljeDq7RIc6pcyZ+yJhwh8f3h6HIAkyP4Kx2/3EZ2IPPJWxEYgR/ReQ K3C1nBAbB1TcgEpIptNo2CQpKRO9lIHg49wfQ6nonQgebxq/exBueZgaLS1DypecdP IEgi0InggnDMWU671hhIhM2L6AG8r7fSny70Fem8= 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.18 166/181] ARM: exynos: Fix refcount leak in exynos_map_pmu Date: Mon, 27 Jun 2022 13:22:19 +0200 Message-Id: <20220627111949.499927418@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111944.553492442@linuxfoundation.org> References: <20220627111944.553492442@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 @@ -149,6 +149,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)