From patchwork Mon Oct 24 11:31:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9576 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp527583wru; Mon, 24 Oct 2022 09:01:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6wqMK8gpYP6fde1lgd7dl+tsb3OcvBwUfcPPp/Y8qkRM6Z3lwH8YShkl1+SwMNAS0bIBBX X-Received: by 2002:a17:90b:33d1:b0:212:f02a:e5c7 with SMTP id lk17-20020a17090b33d100b00212f02ae5c7mr12680065pjb.137.1666627263451; Mon, 24 Oct 2022 09:01:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666627263; cv=none; d=google.com; s=arc-20160816; b=zBy3hpn33F+wzigKuv3nJc2CubPfUctLdJuEt5KcY7W+ycFHNJe7rp2xNbh4RVFEOB 1GnmZnQnGIcPP95LMZNCLm6394wEK3T9uiwzfiYgdA/X/ImA5hQ1SAUEig1rWkCuEyqL VHTCMrTxHMaOMqkmSAAQ9zrlqWemzNnrKLeLrYJLgsPcqSIYCOQq4R44PJyp5eGvXEkn 73A6eDroVZimMJBcEVcZ6qS7KSO2S5ECUddEnHTWfZaS+1Hj7jEkdmvoXkA7gACXWUW3 N5xBpdCi6JEK6lc8IQMfovo92onuXXQgKlwFLrsoG8qTCxrKzjMkxDuCUI2eEob4p4kz 012w== 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=2qVIODp5ADcvv0FBqruk2mYFisBuVhnBvrBOzoQQd2g=; b=to1IS+YVuZAI5bVzyvrt4mRI7RgosLieqgO71H3KSQbxQZGpCQbQyhHteRlbtiYlzt 5E63t+WUxTMY0ZUEJkS2Ua303C3GV8u3RCQ31RzcDMbEp0b4aT23RMyoXG03o8Dz6O54 LgtwH1AX8276f3LC3kOXda/B2V6hs9efFbYx8hJEyP6Z2bNfOuXTBHYdMoIGGXFTHZpj +ymPU4Fztc9yc6TNv1SxeClhn28hgV5xMK69NRG7nw/5xYduK7M2SYqEsaGodSGyadPv HQJo0IBwAlpgytEJ0OQdpYyp3M/Qo72P0fnbRIeb/TbKDw28MpKunSI33CCSi4Ec/sfG lQvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YTGxj2tE; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u18-20020a63d352000000b0043158b8ca77si34660868pgi.123.2022.10.24.09.00.48; Mon, 24 Oct 2022 09:01:03 -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=YTGxj2tE; 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 S232361AbiJXP7B (ORCPT + 99 others); Mon, 24 Oct 2022 11:59:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232198AbiJXP57 (ORCPT ); Mon, 24 Oct 2022 11:57:59 -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 847799B857; Mon, 24 Oct 2022 07:53:11 -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 3BBB8B819F8; Mon, 24 Oct 2022 12:50:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 984E5C433C1; Mon, 24 Oct 2022 12:50:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615825; bh=sGvbRb5NiJdw7oxaNFUv1rbOzyzBclWqFbsrGH+8zOU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YTGxj2tEuy3QwsJ+tWhygXSzvYPbblLEnleWgixNS80hG5rTrKXtDc8pgPm9uw0Od HBYsJkXib+QUnSJ/DaBYTITuE24prWevg0p9G+vT0A+2le/ih+qSCn9kB/4H84kabM V28klhIBdANKQBV6wsDaN1lRftGuRAbYY5P+diLM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zheng Yongjun , Michael Ellerman , Sasha Levin Subject: [PATCH 5.15 366/530] powerpc/powernv: add missing of_node_put() in opal_export_attrs() Date: Mon, 24 Oct 2022 13:31:50 +0200 Message-Id: <20221024113101.609026980@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747585349325140765?= X-GMAIL-MSGID: =?utf-8?q?1747585349325140765?= From: Zheng Yongjun [ Upstream commit 71a92e99c47900cc164620948b3863382cec4f1a ] After using 'np' returned by of_find_node_by_path(), of_node_put() need be called to decrease the refcount. Fixes: 11fe909d2362 ("powerpc/powernv: Add OPAL exports attributes to sysfs") Signed-off-by: Zheng Yongjun Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220906141703.118192-1-zhengyongjun3@huawei.com Signed-off-by: Sasha Levin --- arch/powerpc/platforms/powernv/opal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index e9d18519e650..5178ec6f3715 100644 --- a/arch/powerpc/platforms/powernv/opal.c +++ b/arch/powerpc/platforms/powernv/opal.c @@ -892,6 +892,7 @@ static void opal_export_attrs(void) kobj = kobject_create_and_add("exports", opal_kobj); if (!kobj) { pr_warn("kobject_create_and_add() of exports failed\n"); + of_node_put(np); return; }