Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3408439rwa; Tue, 23 Aug 2022 04:24:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR4IAXTPKk9FNtPbTK9Uf/XFqGF60PU/yPA8tZvzIFUddQUkagzLv12HSW92ldDyTe0Q5eTT X-Received: by 2002:a63:91c4:0:b0:41c:ce66:8ab7 with SMTP id l187-20020a6391c4000000b0041cce668ab7mr19880729pge.602.1661253857738; Tue, 23 Aug 2022 04:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253857; cv=none; d=google.com; s=arc-20160816; b=nm900u8gUIOT/rPXYgJbZ1B/zz1o/sMPbQ2zKufgnwzPnrlCU8IbXU6MGfG74sFYMu PW8o8z87vDfs1zJizBQ1x/OKjBT+PYHf5oavmievLKIaqwshc1HQ72CyfiD/FKo3DXuP YP8cjwbr71KMdnUQ4yRHFGVKGty5MNP/E9QPh/O0jMQSe99aPPS1S34lcr8l+7nBqIwc ih5dbif3xDaRsBezoYEs1SdTVKf6SbAmxi3C92j85Vb5eg7s9H1QrnGmrA66OBeqH6pu vyn6bI91YRIjEdHfEHTXHY03MRZgPt9J2uNG1uaaQKG175kzqg99HKlvcDV7ZmEgYFXd YMGQ== 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=s7sMCf7mgXkkJkuGeZ9Q/WZvFR88zeJrf/5/cS4saAw=; b=rECGl/mAtqDM2XDPh01+uRaz9McmbHVxAjJEjv4by0e2gwMum8gSBCGVWfVejDPEeS hWYZnA8fbK6myo6Y4Nj7govmvrkV4V5oVpnsjO8wiq/pYOBqUoTGRuS6JdnfcH+xKXW5 7cuL1qMhHgYICT0LFeOgWxdZapS/h/v+bLqg4WS+kt31aDJXI1U4V5hQ66djgULRcrns 8yaOoOF80bTeurXx2Dp4MKcitLiaLJbMVX8b5u7km4DVT4jq2LBTN4dsxldmGokLbC+3 VZRL0Q8k+9P/M5aPnxo18/+D31HyQzgvQRRwJvAf67JM/xNKrJWlMEwoCu/yX5b2gNjw hlZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w+NpqqPp; 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 q2-20020a170902dac200b0016d43411b7csi14769895plx.415.2022.08.23.04.24.07; Tue, 23 Aug 2022 04:24:17 -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=w+NpqqPp; 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 S244146AbiHWKtQ (ORCPT + 99 others); Tue, 23 Aug 2022 06:49:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356472AbiHWKmX (ORCPT ); Tue, 23 Aug 2022 06:42:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E56D5A99FF; Tue, 23 Aug 2022 02:09:48 -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 89D1BB81C65; Tue, 23 Aug 2022 09:09:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB201C433C1; Tue, 23 Aug 2022 09:09:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245787; bh=ZzqMRbdrqte1VctGQUkxxlCydb4qOwUpSBfBm/p//9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w+NpqqPp2fD9oGNgPu9xNKHd82LZBbYZOIE7lbSHvoK5WeXy/umH/ddjAO19rnLOr HygUlVlHznsRl0vpU3PxJMt2U4sD+Rkx1GuaZowcODzchqgUQe3zuKlkTEw57yq6Dx s8KP5ve8F8MDEowtKwNHGIzZkcVFGflXnrYoyUfk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Michael Ellerman , Sasha Levin Subject: [PATCH 4.19 172/287] powerpc/xive: Fix refcount leak in xive_get_max_prio Date: Tue, 23 Aug 2022 10:25:41 +0200 Message-Id: <20220823080106.556226425@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 [ Upstream commit 255b650cbec6849443ce2e0cdd187fd5e61c218c ] of_find_node_by_path() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: eac1e731b59e ("powerpc/xive: guest exploitation of the XIVE interrupt controller") Signed-off-by: Miaoqian Lin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220605053225.56125-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- arch/powerpc/sysdev/xive/spapr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c index 5566bbc86f4a..aa705732150c 100644 --- a/arch/powerpc/sysdev/xive/spapr.c +++ b/arch/powerpc/sysdev/xive/spapr.c @@ -631,6 +631,7 @@ static bool xive_get_max_prio(u8 *max_prio) } reg = of_get_property(rootdn, "ibm,plat-res-int-priorities", &len); + of_node_put(rootdn); if (!reg) { pr_err("Failed to read 'ibm,plat-res-int-priorities' property\n"); return false; -- 2.35.1