Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3407096rwa; Tue, 23 Aug 2022 04:22:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR5dX+219pR+iObLCAWiBGV40UDX2h3YD/NYE850wN61dIz1gqtCON7d6N2TTT0rOA+6fmqj X-Received: by 2002:a17:902:ef50:b0:171:516d:d2ce with SMTP id e16-20020a170902ef5000b00171516dd2cemr9626733plx.171.1661253770511; Tue, 23 Aug 2022 04:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253770; cv=none; d=google.com; s=arc-20160816; b=IpU6JyOPuRb4dytz1hkpVI5kZM39pBQkRnvIfM26KVDBVj5EyzdN2KijuPO0MK9QjE ZnOPiM94LhOjM9lss2a7PXFu+fms7Rs6+QO6T56crdEc01lC4G+kwK0J6ZQXCnsLcHNr K8ChNn1XlSm7ou0fSxrfqKWWiQ+px4/De6U2/Mpq8P7MoMFi5E58UKJjM79zVpJwRp+7 qfhy47D2xW+rq1Ab4bZV2UURT/Jj6+71bXiAO5lA2og02l55MqPtA3p4GJYaDR0EPZb3 NRr6GGJQJxbPt1jSwQ00GaIB9MmihdQ4Ysa0nT6R3Rkzfex7yz2OSJQ0Qei70PFIBtFP eU4g== 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=GhKNRjcYmtTmRkn/a53/Q36RQ7ZPWJdUqic8JCj158k=; b=f5jvr4w0tSOFlIIBrE8nyLQcI8o/ysC5J8xAHE2DOGG+xxc2/Kq+ei5eh50/6zK2L/ 6hQV3+5opDl7c6JUV31n0B9ae6nitWBqwR4/eV+zqsCO9COUaYrVX9DOGRbFXsPEVkS7 bPT3rYjmVHNSjE/mPst+esZDj04PTq+Pi4ii7a/PdIapQwDmBg3/Ld6Xf1h3beFavZ7Z 6WeOlNr8n2bgTmZcES1PXcrf07JKmoRqjMzdKG33oUb6cXgNy3sC2mLai7YHABd4Ilzg bKJdNWy3VAQlhXZBUW7iZEpfeDHdovBaLHXcoYEAoxsR2SpgfTWCBp5BOfb2kE9fss0n WeHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=m3N1onIK; 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 i10-20020a17090acf8a00b001fa99b4efc7si16247024pju.127.2022.08.23.04.22.38; Tue, 23 Aug 2022 04:22:50 -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=m3N1onIK; 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 S1351934AbiHWKA4 (ORCPT + 99 others); Tue, 23 Aug 2022 06:00:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352320AbiHWJ4n (ORCPT ); Tue, 23 Aug 2022 05:56:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51F80A0300; Tue, 23 Aug 2022 01:47: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 dfw.source.kernel.org (Postfix) with ESMTPS id DC50B611DD; Tue, 23 Aug 2022 08:47:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0335C433C1; Tue, 23 Aug 2022 08:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244444; bh=+EWlPLXccA8DIb+f4YN3r+iDOk1ctotMAa2U6XA4CPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m3N1onIKnCCPtSUTvG5odikgIhNvyfQ9Nlm3ej8NtMO2gB+oYdt/uzW/Y+d04mgy4 Hx1g/1TNdZPxxpVvFae/BZoEaYGI5pkijQSWVviq8iKDx2jn4x5eWPJIxM3YYvYfHu NZSlWRbQFv3gMljPGU9czxhAqcaI+CV2vUcdgrZk= 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.14 138/229] powerpc/xive: Fix refcount leak in xive_get_max_prio Date: Tue, 23 Aug 2022 10:24:59 +0200 Message-Id: <20220823080058.616954930@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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 10235098a726..e9b8e06c9dce 100644 --- a/arch/powerpc/sysdev/xive/spapr.c +++ b/arch/powerpc/sysdev/xive/spapr.c @@ -569,6 +569,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