From patchwork Mon Oct 24 11:31:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8754 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp430321wru; Mon, 24 Oct 2022 05:41:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6LfFV7oUxpXJ1UvRICUx7S2qRD+YjBJQgwFbPZWLBupiXVCfWnp1WCDRJSQYPyS1Ikh+kh X-Received: by 2002:a62:4c6:0:b0:55f:c739:51e0 with SMTP id 189-20020a6204c6000000b0055fc73951e0mr33124615pfe.49.1666615274691; Mon, 24 Oct 2022 05:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615274; cv=none; d=google.com; s=arc-20160816; b=aZWA1ztYt+p5WI6bj7+eSgZmZZhqQB6yYjviQFq9stvYhSr/tNuIMNnVqyD2QjbKcU jcabTqHXt8X5D2isK/QvfjBhcFK8qvej1HA0jn0r4/b8R1QYe1J96/HscvKPdmGdIdsx GjhX3djQFgFtIE1PA/HDRG77fa2oezmpbXQ0503f2hRAC4i8J+BmXOr4nvjTG5nViE/1 VQcp6lAPgy7wAnIUtrrbOr6Y9G7kpd5jEa+E0/9YnOHMJqFEu+Qem3gxuqpVMug3Zi77 TGdbaDTkPAkiW2TSLjTyxZLjy8w4QrGmKV2KRgIg++wp+4sK3SRl7E10FCyzrn56gdRJ 6M1w== 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=/USIhJkX/VxQ0luiqp66HPRV+tWSlvbveNkN9wKBowk=; b=oty11lCof0Bg2KpmbiMxIYyCcm12Ci8XKH/0jYcFsoEtdqNCOiYUNFKR+boS4c28p5 5+Pc9sv6DsXOJl2d/ZsWhFK5BxlSURG033QdYeq+MmG0n/alWcAue3pMGEqe7zbY67PF 4hK7Z6wMNdaTep2vaEYKSSXJPudfH3kfVVugKBPUygeLYJn7MGCc7PQqJMPny1GzjE3E Tq9swMKxFzZxDIs4hFfwwaagNISwYSwlk7A/g06yiiGPqa600woDTyqiKoaVecw0jYw7 TfPd8m6lFUrnLNmPG86LEPxqk1HsZBZtTVt7mRl6vJIkKCwkX/nAPOVu3jCfpy62od+2 Y/Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FgE7c6gT; 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 j30-20020a63231e000000b0043c1481a835si35475236pgj.267.2022.10.24.05.41.01; Mon, 24 Oct 2022 05:41:14 -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=FgE7c6gT; 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 S233774AbiJXM25 (ORCPT + 99 others); Mon, 24 Oct 2022 08:28:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233772AbiJXM1v (ORCPT ); Mon, 24 Oct 2022 08:27:51 -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 7F6BD86829; Mon, 24 Oct 2022 05:01:43 -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 999ED612D5; Mon, 24 Oct 2022 12:01:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABB86C433D6; Mon, 24 Oct 2022 12:01:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612899; bh=OPvKQlWY0F2insuCibDJuN0GBxXXp9dptRoxA7EYvbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FgE7c6gT3fKVaxC2s5O9rIDeYR/khoo4XP+3KxHGz98BPhmpgGX9ysIQAeBhKOuMQ EvxSzLIw7vAzMtOO8jezP/C+SQI07zghMWuaLqdg7BhJXVxPgbcYIgY+PGjbcvm4ff +ObFDzdO3FyGj3diqPeR/THFJW34KouUx8L+0wgk= 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 4.19 162/229] powerpc/powernv: add missing of_node_put() in opal_export_attrs() Date: Mon, 24 Oct 2022 13:31:21 +0200 Message-Id: <20221024113004.233050720@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@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?1747572778535719474?= X-GMAIL-MSGID: =?utf-8?q?1747572778535719474?= 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 edf9032e2e5c..96a3d23132ba 100644 --- a/arch/powerpc/platforms/powernv/opal.c +++ b/arch/powerpc/platforms/powernv/opal.c @@ -740,6 +740,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; }