From patchwork Sat Oct 22 07:26:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7585 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1106326wrr; Sat, 22 Oct 2022 01:37:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6+CUl4ACYkUklXKhM9YT/xsmanwEGYAeq1N64osh9lygff9SEYVeETuYGHWLpr3xYDxVAd X-Received: by 2002:a17:90a:8988:b0:212:e1b9:e8fd with SMTP id v8-20020a17090a898800b00212e1b9e8fdmr2697574pjn.148.1666427851343; Sat, 22 Oct 2022 01:37:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427851; cv=none; d=google.com; s=arc-20160816; b=RMULLX8jlBkes04KSgqgsPyQ92eTy5O3Obw8I+tiU4Oe+Vzzi/j83EVzHFoWzmOWC+ iJsOyqwlfzr1pJwwDtX7KxHlIryPh+RXk+DYHf+fF5HR/yWwcrfY+30HAG1PnZgpb0Rb L7BMOCUTrcpcE86nOD/IJw/lT5WYTlEetvkH4/PJ+MqKYYDi7NVp1mlj6LDlT/dlDPj/ Zp4btNk8QwRFUQbqI3yza9rd53q5tLX3lEG+D0nDX9ae6DWrWdoOwENwU83pFOoiZC8J vkeU6p/7t2AIH7cRp0OQuFHNYis9f08RtcYx4URacD9miKZvXbeKTXrK8M9KHJivYCf/ 4p/Q== 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=1GMx6OuFidB3j1RSaOH1gvLOJiKUKowCpwylL/pAduQ=; b=fQQkqSxAFkxRTl0Cy7SHhKB9wiiKsOlKGZSk2pz0l9tNIewv9nd1l7eduw1RjR1Brw DOxGhLaqxM8t1AqpjAT9XHJt84fch4tvG5Fb84GK/lPexrIWSorKtzj4AMUK4aKYbuB9 bsiiyEHB0PyRClqh98S4k9hiPd0SuIWy+mVE7uc96oSSmtjzJEi6L0DQMEiAYVXNwugd tJZD6B/m8QpLhSh4/sp5gPgHGWfFFVMyMplTWZQKf3FPncIbwoaJ+w+zjvH3T8/0mDSl tOLqTXSeRn50ivHq8Mk/XcEmBu2AAeNIwtGEIxLjG6PomolcLFIUjHqV9EBMv/jCPNUI QGnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dwiNyuxj; 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 j5-20020a63b605000000b00450b99448b0si27005452pgf.341.2022.10.22.01.37.17; Sat, 22 Oct 2022 01:37:31 -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=dwiNyuxj; 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 S233725AbiJVIWr (ORCPT + 99 others); Sat, 22 Oct 2022 04:22:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233717AbiJVIU4 (ORCPT ); Sat, 22 Oct 2022 04:20:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D461937F9F; Sat, 22 Oct 2022 00:58:39 -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 22F2460B8C; Sat, 22 Oct 2022 07:58:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1463BC433C1; Sat, 22 Oct 2022 07:58:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425518; bh=MzqN5J3LzkgF+sMfK6atxZHurz4IuMxAyc9YhNaRH90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dwiNyuxjS3q2ElTURGtps1/ecY6NUqkiIysu7pPe8ZETlsyl7+9xU4vizj8+CBE4D /hHXwMuqIuy1kJM2o+27dE2BJdioVa074F0famm8yljbKpC/ytFoDliqIY7gFYZzfF JDnjMl+t+E6k3JCHQtBtiZ3JPiImvdyKLM9ugxss= 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.19 497/717] powerpc/powernv: add missing of_node_put() in opal_export_attrs() Date: Sat, 22 Oct 2022 09:26:16 +0200 Message-Id: <20221022072520.249526274@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747376251034810061?= X-GMAIL-MSGID: =?utf-8?q?1747376251034810061?= 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 55a8fbfdb5b2..3510b55b36f8 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; }