From patchwork Mon Oct 24 11:31:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8848 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp432928wru; Mon, 24 Oct 2022 05:48:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6t7ubGfah/S1Dg3+taCRrBJ9I356AlXu2XR4zcoYsvaerfkR24ZexolHwZWsKBS9sQOxsx X-Received: by 2002:a05:6a00:705:b0:562:b9e1:d0e8 with SMTP id 5-20020a056a00070500b00562b9e1d0e8mr33650003pfl.0.1666615686283; Mon, 24 Oct 2022 05:48:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615686; cv=none; d=google.com; s=arc-20160816; b=R1kJwSHX30AEbz6efAoaSIETvQbsEoJse8aGy7WR3f1RoybGX6VONolgbXjsFTYaVC Xjkt2c/CZvsF1VoIUJUQgJT7xAGJaiegNda+iZiMQD3e5EpP3NvqRnpAk/fPnLSFNjMv nzsSdsZxNFQDeRCfl1wsGwclKLR+0qllGifsCLabnxEiqC+SRQiVw/UDJ5Pf676ha22H tFXDPkxlIenu9jXftNkKsgWEdB5DDHGsA6bQufUsmExP9mBaoEjnF/8p1mjAo+vBq+95 UcoDQBxiSVTOSuIg40qyQtW6Razbpmn2cSCSwH2PNm4Aj2KDzXyDoW4wS6/BjJRG6jcR SXbQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t18-20020a63dd12000000b004637c92ef98si37100453pgg.195.2022.10.24.05.47.48; Mon, 24 Oct 2022 05:48:06 -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 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?1747573210092117693?= X-GMAIL-MSGID: =?utf-8?q?1747573210092117693?= 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; }