From patchwork Mon Oct 24 11:31:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8960 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp436470wru; Mon, 24 Oct 2022 05:57:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4aru22a51VJGeSewbn74VhwTetRhkyM8UAHunjgWxCidjpUrnq1te75G4Eo1JTR4kV/olv X-Received: by 2002:a17:902:c407:b0:17f:8bec:e7f4 with SMTP id k7-20020a170902c40700b0017f8bece7f4mr33304833plk.156.1666616238473; Mon, 24 Oct 2022 05:57:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666616238; cv=none; d=google.com; s=arc-20160816; b=oegJzaD7d4OrCprjoWRKAIUAlD/JP/B1j4M/Z2UH7SAy7vVwQ6tmyiv5Lw/7KbtlLs rxDoq9lYB/CH1yYZglYxFUgqJAFGzGJkcS8/0b32Gkod/UimN2T/UYlfXBYC+QWORQt/ 92PxgefLGqQi1kZmhwTnlf11IqYFhd2XU7Ngge2Ph1D3qY1cNlwQZVWJzbdQn3w4SZCk YaaYoNm+WRvHrbehitZCzlnB/h2Sw2uaHD0LPIzuONjp3HJMRiEZAKNizjxyxBllraqR VebVPPhAp2XPAkiZcojceFy63sIgUCdw9hsoMH3qk8V4dqC7T3XpZK0MYaE+pvje5NKr advQ== 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=pUSxf0b7e7cshvsZQ0DUN2vYxrMF8yuu21db3cu+vqo=; b=RVYCKiZy1fL67o/3jgjHsryFwchfvWkUw2K4qMdgOtzXdtIDEAWlWbPVO22Ee6Vo5e LEsh8xjKVuJqvJMdvNhZXU/rJapM5sW+s6NsLCKYX24HSa9makZalsRNdUqXe8z+lwG1 kPAnd9aph1Q+Nio5Tea1QE+yNNOXMNgA4SSonROB9WcNkJLYP10jt+i0RFuzTsBYjBoB /xeVPX+wp5q4iFl3DmGy22QsMuP4pz3If621O3XQWMa0YrzHW8TOujkX5B843v7ugme9 RQIu9y+ZcrSbOsEU9G21PwrHKTlJU5vvYlSyvN1GlQEYT5MVccdYDjQuAnluqiTyQD2f Q63Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vZadaG5R; 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 pi17-20020a17090b1e5100b0020a47a4c951si17694139pjb.147.2022.10.24.05.57.05; Mon, 24 Oct 2022 05:57:18 -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=vZadaG5R; 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 S234560AbiJXMxS (ORCPT + 99 others); Mon, 24 Oct 2022 08:53:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234533AbiJXMvg (ORCPT ); Mon, 24 Oct 2022 08:51:36 -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 F093D9258C; Mon, 24 Oct 2022 05:14:06 -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 EDCBD612F5; Mon, 24 Oct 2022 12:12:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A6C2C433D6; Mon, 24 Oct 2022 12:12:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613534; bh=hbtamw6ANcLlqJnUj99gi/JOS6QSE39ZeJmw7FKhYkk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vZadaG5RogQjdWakBnjc+TP0XXW1QKBc+/ywG3dWY1seIF9BxcKxAg9gyKUTosv80 k/3AhAPhGnE2SkXyEhdFVCDqczi2Dkg5DvcDBWatSK/GnFCFeXBoisJgYUA1SQdjoo xmXWkCcubIfTNFB9NtY+05JO2lN23boJlzzMAhsU= 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.4 173/255] powerpc/powernv: add missing of_node_put() in opal_export_attrs() Date: Mon, 24 Oct 2022 13:31:23 +0200 Message-Id: <20221024113008.547706982@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747573788514933944?= X-GMAIL-MSGID: =?utf-8?q?1747573788514933944?= 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 38e90270280b..c3f968429161 100644 --- a/arch/powerpc/platforms/powernv/opal.c +++ b/arch/powerpc/platforms/powernv/opal.c @@ -776,6 +776,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; }