Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3494940rwa; Tue, 23 Aug 2022 05:49:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR7sifCZLZX93JoYTppznUWae9u2YBbIo4QLw9kHV57mJU0aBSgqRPC86Rt61+IeLmwImPLS X-Received: by 2002:a05:6402:400d:b0:446:6fe1:7663 with SMTP id d13-20020a056402400d00b004466fe17663mr3523469eda.376.1661258984787; Tue, 23 Aug 2022 05:49:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661258984; cv=none; d=google.com; s=arc-20160816; b=yoahW1foYeizooq4vo50Ll2Iu6ROZk6jGNLNIDZd7iF5kCnCxu2M8AE8Itaj6+nOo2 Uyknhe/CNCMcKup+vpPc1jiwEePIgctRBUynJYI82S8Hy7PaC6ZN9atizUQcGpl7QZcK JfrV7gi1bisP+7z9aj/V6jaVjB2iAda4b6D0MmqJos4HpqqQSsKRbtZ1f812Ygyb5/g4 tZvZ+vURp/0c/2w8Ssd9ohOaWxF8+PP1Nl/2RTHheLTf9/mcrux9wWAUBWp8wt7J9YRi 8nQsaBflvSeeZ7Fq0LbJiN3F9MIlsTZxzvgwjmLJ4KSlkm+Il4Xt0YbV2DFCg5mqz2J1 sGGg== 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=PAb3RQ9+y5aK5530b0l/+bcAUk7cZRl9pMiR3AjrT/8=; b=CJmKnXMcAxpL3YXKC+42Xpa3jjULeBrnI0pbC30hpu/outfE1U2/jZQrFK93DRcwMl 4utAu/tDdDZ2lDHsb+E3br9AqPQxN7aIjA2CTfkKApXn7xqyeYopDE1bxb3jZ2FMR46O 8IEr6jByuGoutqDHuwrkxYV0WMMC2VeV1O1rk56mvKwlGaHpDaM+1ismmlJgebk+sfsu OH4AhI+w36ux/nYD5qYNGnYDvbqvP+CDbmSL93UT3Judqi0G8R9me23EPqZATUli86Qf xfuGQFCxR3FJPpdo7ZvWGgjKEG9oALJK32loBv5qeuFMNnAP3VCJHVGoG+pFMaH+O8Gc HQcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y5gaQZ+S; 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 j11-20020a05640211cb00b00446c25c98cbsi2589175edw.347.2022.08.23.05.49.19; Tue, 23 Aug 2022 05:49:44 -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=Y5gaQZ+S; 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 S1358002AbiHWLoj (ORCPT + 99 others); Tue, 23 Aug 2022 07:44:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358228AbiHWLlS (ORCPT ); Tue, 23 Aug 2022 07:41:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95091796BA; Tue, 23 Aug 2022 02:28:56 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 3B36961174; Tue, 23 Aug 2022 09:28:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 446C7C433D6; Tue, 23 Aug 2022 09:28:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661246934; bh=/aztHlH5HHXIVtljODHpAVEb0ZwqTgdiruIxscLrmRw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y5gaQZ+SMmruP7oir13wyWYAgHxaGXZoQL3l0mWMK4g/M5UsPfDJy+v79Y0CfwVgZ R3I06N4+h2ZcJJN/htuQmTrScZMz4wx3voAHcazoKfIWcdc+bKZfRzjsfCQzPcVtmn mKg/rpXPVVUXI/E5MP76GLka3oLVH9k7wZV66T94= 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.4 235/389] powerpc/xive: Fix refcount leak in xive_get_max_prio Date: Tue, 23 Aug 2022 10:25:13 +0200 Message-Id: <20220823080125.399030631@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080115.331990024@linuxfoundation.org> References: <20220823080115.331990024@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 3f15615712b5..b21d71badaec 100644 --- a/arch/powerpc/sysdev/xive/spapr.c +++ b/arch/powerpc/sysdev/xive/spapr.c @@ -683,6 +683,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