From patchwork Mon Oct 24 11:31:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9642 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp532864wru; Mon, 24 Oct 2022 09:08:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM46V6FKFU7Z+43+LHAB6ZTVYwp/k074l9X3QrVTytBnavRmBeBsSkhLSkbPdOrkTaZDV35m X-Received: by 2002:a17:906:7308:b0:78e:191e:8389 with SMTP id di8-20020a170906730800b0078e191e8389mr28472918ejc.170.1666627693814; Mon, 24 Oct 2022 09:08:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666627693; cv=none; d=google.com; s=arc-20160816; b=hnfy/V1D9VTxaRDSUD5GkNWuUtjAdB/QAvKwx+dT/UqrFhV/jhs4P35w7Y0X7cgOic tdEbYvDqBvcdXOF1uNV8/pLOtE2IP+1ObVFCUWjiToWsN8fWCWn4c9aNggN56GvpTPow ywYg5k3LggCpsKuVjOzI3pnTRFlJYRbPXKNgCB6Iyt0KxiRJcq3k8YvCxBYvjJATxYK2 a0sxUYj+QPzLNq5Pru+d+o7hLs+xd0XOGiiBge6BPOIMtdEH0JgpBJ3P9t2RrH+dPQJf Fec8EZiBsCnALarars5k5YdYxtTftB5X5eM5HIn8dBWNd0TtsnAIIrjDZpT2IgbQ/xHX Vtqw== 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=1a4moYShhHgdSxiZgoqNAxhQr3Tw69gy6Bwxd79gq+Q=; b=eo1PBqrJ/Y3LCTATJGOAiTMwri6beozGwDUVZBPqmIeS49AGE/Y5GuDgA76PpUK/FY KQlx7Ds1RX/JQDrKSAceqbdphikAVjd4MkO/6Se4Z4cfHvtKRoEqGedbBA8cdJk4DYte A9zNvDFRDeQdC3FVIc+I2INi6pUTHFbKThT/f7/x07JXBwZ96pdOtj3jaDCeyrpAOG6F uOdK+7KnOKjMXJwO1CwWQgCNUxLpHpR7cu9XSI5uxEQ3YSvpYA5Zq4IXCmjrctjlErLC JF5YQYDCEsk6QUUizg6fajaSCo+OYLkaiHgKdEWBxJdeAspTvqeiB1vkSIBEDt1Ts4F4 A+iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lT5oE62B; 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 i29-20020a50d75d000000b004573107a5basi147719edj.352.2022.10.24.09.07.47; Mon, 24 Oct 2022 09:08:13 -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=lT5oE62B; 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 S233237AbiJXQHM (ORCPT + 99 others); Mon, 24 Oct 2022 12:07:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233055AbiJXQEM (ORCPT ); Mon, 24 Oct 2022 12:04:12 -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 19AFB34713; Mon, 24 Oct 2022 07:56:27 -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 EBF69B8136E; Mon, 24 Oct 2022 12:27:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 536E0C433C1; Mon, 24 Oct 2022 12:27:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614452; bh=n8jAJNK8RHfxHdDp1rMTFCzsd2/JLy6UGwwnJymwJos=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lT5oE62BfFZHIphVNwdkF/KOok2/5F8Yornbhj49LT1elTVS4e8vLqbm57e4xAmdh JG6c2tLLijrgEdykac57ASx6uNcrXE1H2nClZenXyNdrxAwaUo+gtfTVKS6b+11CD7 wO74bBKNawE7mNbgI8AqNCc3bwXWMz7yaCn0Nv0E= 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.10 267/390] powerpc/powernv: add missing of_node_put() in opal_export_attrs() Date: Mon, 24 Oct 2022 13:31:04 +0200 Message-Id: <20221024113034.282951537@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@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?1747585800486213300?= X-GMAIL-MSGID: =?utf-8?q?1747585800486213300?= 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 c61c3b62c8c6..1d05c168c8fb 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; }