Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2918731rwb; Mon, 15 Aug 2022 14:03:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR5hQheehMxDZ5tVMXcItxKLgyo1jpEWtPZLnyojLlkmkhCHk9nrAgrWVC4rAfwaRrvA+Ka3 X-Received: by 2002:a17:907:7619:b0:730:d709:a2f0 with SMTP id jx25-20020a170907761900b00730d709a2f0mr11645973ejc.673.1660597400705; Mon, 15 Aug 2022 14:03:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597400; cv=none; d=google.com; s=arc-20160816; b=BjKkegNmUGP5TodKOqOdkz4nPLIDfKf4UEhspvlfXdmy4wHwn4XgGEWDuha1G6cWvy dQAK64fxGhTLQilfZtTmXQNdArMeu6RiEda/4THRD7VcRK6VFqJxZqa7+erDFjttPcKL Exugme9uZQHz5viLlpC4mJCSd2eZTOMj3PN8GiygfVeOyyTX/fQZn9W2BTF15AuSSjEF I5wgGlk2NxmcPbGd81UT0Rrns9Su3I1fvOpD4Tu+1ifwu3st3WKoPBOZ5TXjFEzeOdxS n3g81H+wRz4DwEVC0cKNm0PkitbGpWv5zOC4XA1uKUm7ImZt4jfa9nuUtrw4mRrRwH9x qi0A== 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=lBjLDhRg4CHRGzp5BwXqdbAw7Dg0A93FAjA5Mzm6ggg=; b=wHqG99pK4R1gECufOkOqNpCeXx59CHnWARAv8kQ17VrQJRi008xlbmZKGxIxf6QpEW gV2hTMqN181v3TBde25l9N1iCwP84Yl2weUsBaHetkLCOdQMA+NOMwGv8+VXuMpsSJLl CHgqPHroamuO2koqOcGAOr1RLCoh9/6N/XnGcfqNlLYtk/qLeylXWJ9NgEie4A6/5990 Vur8FbRiVjMjQfS+qp6pmmZMHaeS/ycfbviL8Hd7pEwd5tBfYcNe0pC40VSUvVH4fcq/ gyynjUKwFwHRyXlZGwIHmeDbF5VXPU9qZRjaKKuTBms/LTg7t4PHY/PPDVvuNgl54TWr AJew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=egTjS53v; 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 b26-20020a50ccda000000b0043ba23f56a6si7289856edj.200.2022.08.15.14.02.54; Mon, 15 Aug 2022 14:03:20 -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=egTjS53v; 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 S1344517AbiHOTne (ORCPT + 99 others); Mon, 15 Aug 2022 15:43:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344230AbiHOTjN (ORCPT ); Mon, 15 Aug 2022 15:39:13 -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 83540402C1; Mon, 15 Aug 2022 11:46:54 -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 0AD6DB8105C; Mon, 15 Aug 2022 18:46:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5025AC433C1; Mon, 15 Aug 2022 18:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589211; bh=aiNS8m4zZFUULNlVvVO20tIZMp6ooCOq2nuoy3iOBus=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=egTjS53vBpPc3YVhrVV7+0aMZwSps3Vyq0UZvnbInTioCj3E/wekTBpeRE9p6ITk3 CzHKcVX6JRNZlZmi6PyN5qiDxsYLNfOnDMJiMCFiD5TOZxozYMwgUicUwMZtAwFAv0 tJ1L7NxhgnCWOxDS5MyjxHHdNK5GJ6N8iFhnwjXU= 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.15 647/779] powerpc/xive: Fix refcount leak in xive_get_max_prio Date: Mon, 15 Aug 2022 20:04:51 +0200 Message-Id: <20220815180405.026057307@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 583b2c6df390..2bf78a30238b 100644 --- a/arch/powerpc/sysdev/xive/spapr.c +++ b/arch/powerpc/sysdev/xive/spapr.c @@ -716,6 +716,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