Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6820719rwi; Mon, 24 Oct 2022 06:33:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM55DGbrxB6F9V7ZxqH21+O84k8uEtE+1f0IDxhenmc7SPVPdvqFw/Nlj09wzOYBDT/64uPF X-Received: by 2002:a17:906:844b:b0:7a9:f67e:a5d4 with SMTP id e11-20020a170906844b00b007a9f67ea5d4mr2410201ejy.136.1666618419286; Mon, 24 Oct 2022 06:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618419; cv=none; d=google.com; s=arc-20160816; b=r5rCUj5nBhpsTi2Hk++4Ml6shL5zF1qdZZmdtTgP6lwQm8juVx8Ti1hG7VUM5K5Jy3 q76fikWHkcTXWtQc0hye9+8dL9ozI0DKL6Vuh/xmO0rLeKjL5sbMC9j/wfDPoYqbiyev wJrwG0g3YAo6hj+BojEQYUgJzQCU40+m3PdAYJc97T4vJ1t5DFJE9wmaBeouDhKoOq3P mOpOVrDSvzQQh1IkX9uSlOmiqXahIc8Q55eAOJAbEep0MPue9uLXcVarimybBRwsRnbe GDRjI7hZkLC6efhgBAO3aJx00TSl+lCnNwEXnwehOjv6Ek/xKBN52TxiZp/Ht7o6OyJK cqOA== 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=LFFZIwOmgwsN4k0Ai/eKfoCNr1wQR97gikplZ4LyFmo=; b=ljxp9rwsQiX2ofwq8qyTmTmn1OYvbtgrxCMxLThMVIqh80Hfol07ecj2uk2fFNeC11 lgvF7pgC0F4FNnqv83+QdSkZUCQnn0mq7UWrvJo35BZxvcrCvX2Z53rhPyqmVl0IMJCl ujTcHpc1tlaJXbmuVdKgVVHIHr8EPYEpHO7azMyCGWJAJyqCegPycThjNgx+g0zI2A/w ezkNdrg9wZEn2EOMLZuJgsEQBfT0562U0VMpVG3tQjf97BRlaeC9bxfiKcPMQ5bzUxv0 weSTi2wHzFZ3Jx1gDVxXooM9Upa6mPNKZ6vEZlXXyUWyWRMHNvism4ZBxejnmPqBepE1 xr3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=U5CAAWGe; 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 qk32-20020a1709077fa000b0078dfd359c52si21138239ejc.602.2022.10.24.06.33.13; Mon, 24 Oct 2022 06:33:39 -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=U5CAAWGe; 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 S231626AbiJXMgp (ORCPT + 99 others); Mon, 24 Oct 2022 08:36:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234369AbiJXMaK (ORCPT ); Mon, 24 Oct 2022 08:30:10 -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 03D6E11A24; Mon, 24 Oct 2022 05:04:23 -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 C09C2B811A6; Mon, 24 Oct 2022 11:52:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AD7DC433D6; Mon, 24 Oct 2022 11:52:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612326; bh=0lbPNCsDRrqENwaCBcpPeVLGu2TkgjKhDAEw/yHaLpw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U5CAAWGeR+YW9yPkjnbUbT3KF6bgJkueqzAeaWDCsUyVhzXNcnJThen8YIcwJl0K1 UzRqU4g2uKE7CvP2DSa+C333Nwdt5jGoZrZQKq6DHkCPjOT/SwXoMKbzvGzwBOcJLT 6dYdSU6pwkTDeThbD5gfcGNVl6ZkVqZaKUZv7y58= 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.14 155/210] powerpc/powernv: add missing of_node_put() in opal_export_attrs() Date: Mon, 24 Oct 2022 13:31:12 +0200 Message-Id: <20221024113002.010570901@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@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.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 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 597fcbf7a39e..c8bc9accd858 100644 --- a/arch/powerpc/platforms/powernv/opal.c +++ b/arch/powerpc/platforms/powernv/opal.c @@ -677,6 +677,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; } -- 2.35.1