Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3027607rwb; Mon, 15 Aug 2022 16:25:59 -0700 (PDT) X-Google-Smtp-Source: AA6agR74BqnDXufZVyHV60wLxqbGzdzrg03iLMz2tjj9Rs6zTrw3b+Vk+f+eCmupN32IK6Ad8ndv X-Received: by 2002:a17:907:a412:b0:731:6cc2:adfe with SMTP id sg18-20020a170907a41200b007316cc2adfemr11748074ejc.74.1660605958983; Mon, 15 Aug 2022 16:25:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605958; cv=none; d=google.com; s=arc-20160816; b=FD5pmZzcoTb/0UFgbS+UQ+d5D50YfFiMd07+Q7pkv6eaoO90mSIiuh+2QQ23QqvDgX cZld/d2VRXhiKLh0zQ/uRftAEepUogug/w640O3OM5uWZxBi/XGocpyyF63e9BuVVGHn aeq1QCwYZaqQXq1BhqUTfTFx2YEWgi8Q7J18cKsEIMAqUThAN8oLWHSEuZAoM0bvgEyR R6XDvc0IvTPgDTefDDQz8KZ5WTo1wBi0kJrYXqzG+SH7xGgh22wL9WBZQFxkxbw5iDq8 Nf73SKl+DT8VIDiztuLYMVG5XotPCvX+fe0EyxOQivibedXw6Vbp9U4+a2wp4X40H+2+ 1pBg== 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=bJjt0wXXeSFWkl8ow/aFk6A+P45yFEkt9Vzc7RtCw28=; b=Ih/G0Phe8IN1dUH2KxbjyZkdMGfT9GfTHW5/Jbw3MXL7gU9YaYTjxk5qgE+BdY8vK3 HSvO33j8EoHDQAYjxM8OvZfiyFpGWR5vk2tiHAP6zpmK8b3umpcM1ADAWf+SL+GBdHnQ v6PTwXW+ff/iN3Va9h/sAkJsOuyD5VgVZybn0xRxCLYp5UY5sRH4QGTP/WH4DxbDiMjm 5B5EdhphMZoct3pMuQm2okTor1pgLV5Nw7BHnMSWNgsuW8xYUlIqBSGN0OM9Pfm7God7 PdTt8+9k5+wPaWogqCi8ojdv2Hy0dgQI91kYMtMQvYbU4mBcAWj9nvcTTVM+2rnm6Yuw XTqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VOMkSoXn; 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 qf25-20020a1709077f1900b0073317fc9d6fsi10419924ejc.917.2022.08.15.16.25.33; Mon, 15 Aug 2022 16:25:58 -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=VOMkSoXn; 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 S1344923AbiHOW7i (ORCPT + 99 others); Mon, 15 Aug 2022 18:59:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244346AbiHOW6C (ORCPT ); Mon, 15 Aug 2022 18:58:02 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CF73696EE; Mon, 15 Aug 2022 12:56:22 -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 B4483CE12C3; Mon, 15 Aug 2022 19:56:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3899C433D6; Mon, 15 Aug 2022 19:56:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593379; bh=An8D4+n6Jwfwj91yuPxd1/4FqbUNxpmahaeImPslgKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VOMkSoXnxPkU16uJuio/Yx/9NzX/3HhNHtyIbErzeEcKNAeQ60b1DSiWri91atBoa xfv42pgg9a7vFnmt6nyTN+i7+JoymJwiV/NhjHhRk4QZ999sGU4HLcXszDLbCSU8gO qGfZtx5vCc1M5ofGYshtl2WAoX6wWfbKXzH5Vabg= 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.18 0937/1095] powerpc/xive: Fix refcount leak in xive_get_max_prio Date: Mon, 15 Aug 2022 20:05:36 +0200 Message-Id: <20220815180507.977193732@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 b0d36e430dbc..013446f5cdbb 100644 --- a/arch/powerpc/sysdev/xive/spapr.c +++ b/arch/powerpc/sysdev/xive/spapr.c @@ -716,6 +716,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