Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3259983rwb; Mon, 15 Aug 2022 22:34:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR42f776N8aIINWrQR4PPQyQsK351Pe/3Ty8P+JXoogxxAwhjNuEVEmXeevb9Doe2OWBEqTe X-Received: by 2002:a17:907:7612:b0:738:5087:9a65 with SMTP id jx18-20020a170907761200b0073850879a65mr5172959ejc.327.1660628044877; Mon, 15 Aug 2022 22:34:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660628044; cv=none; d=google.com; s=arc-20160816; b=Y3+fldghNa/giMqfEpT2RMc9OyzFNtOTTlbaEXOiZIsMrpYyFU33u+2zi03C87vdGF DamCECOQve+pCNeQJ+qw6rhtyxIM2x1ID3TajitD7rZNWUO6QfBOK/LtaTMDHELrwzV0 v/slLTnupP559lAp8gviU8xeu9Fybl9Fdy7S3jG7ROfBqGIXa308D8HNgK8QRg/LEUbH 2Fjy1EFl0eLOzFhV9NqtXBLDnlCZQk29aFYkOhoL3tC2ECnFrHTSsjtyGtbVHVGo+dgM 5Cr1KOU+QSBo0TtESmYtWanfXpcD5QDRl/fZG4rnYUJXhtlx8+oIXrZTIG+Tt7E97jmO 7VnQ== 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=2gSazMNgCmiysR1Cl5SGlQCbBn1ljeMtUuxWxgnhs1w=; b=FHiLg7ecSqG3R6iTuAOl7qTbAfkUtv5lUauqPhHT+wsfjvuhicVPf+Xevklv9iTuDn Frg+MxnB9MiyvkMrHoSF3c2sWGqNmiwfzKptOV7T8viLkCB8fHJH2YKXhbbVTI/JaLMY CvcsylzFaAnx5GDkDnOEen7JYpehJSP+DCZWu1NTUUizPVznq7dreojqs5MS4d1sQulp /9ROTtKI23rFb4YNavmhVRjTYKAj+4a8KU0hh86g273suVqHXTdxqTGMwWfg0RXK+qNg s2dUsh1tSreDKQZyacPvRcwPiv0pG0gyKjaXEwWyoZRaRVtmLm1O7CzrRBhWtV7EA2q/ ioJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TncXf3ks; 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 v15-20020a056402348f00b0043a10e5e81asi9576738edc.66.2022.08.15.22.33.39; Mon, 15 Aug 2022 22:34:04 -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=TncXf3ks; 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 S232951AbiHPEw5 (ORCPT + 99 others); Tue, 16 Aug 2022 00:52:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232615AbiHPEt0 (ORCPT ); Tue, 16 Aug 2022 00:49:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A384D197057; Mon, 15 Aug 2022 13:45:29 -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 85421B811A1; Mon, 15 Aug 2022 20:45:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4BF5C433D7; Mon, 15 Aug 2022 20:45:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596327; bh=k935GoVJXQbcafwXpDDhnY454TvxIKotimdvrKaiCQw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TncXf3ksVpTioUsP1uwX4DYE9WI4mU9eNZ32/eiS0eVjr6jpyoQ2lsn5Wh5gi5VeB D6J8HA29fPnL/z+hbNt6ouhEqVM2SQIP9ysweP9QKVOvJOMtbUYPAGqtxOsOtTejCA Y/aFePj+G2tp1bm65Q+s5qn5bhq8eSp34LywKKBc= 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 5.19 1011/1157] powerpc/xive: Fix refcount leak in xive_get_max_prio Date: Mon, 15 Aug 2022 20:06:07 +0200 Message-Id: <20220815180520.307845151@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 d02911e78cfc..e2c8f93b535b 100644 --- a/arch/powerpc/sysdev/xive/spapr.c +++ b/arch/powerpc/sysdev/xive/spapr.c @@ -718,6 +718,7 @@ static bool __init 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