From patchwork Wed Oct 19 08:31:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5513 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp336756wrs; Wed, 19 Oct 2022 06:47:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6BJXqHag+/k5cYGWF3KWqRdVsasCTgDBwSMYQrRFc9aadEIl62/d8Y1dAvz6zFshrbMI/6 X-Received: by 2002:a63:8243:0:b0:463:10d9:f150 with SMTP id w64-20020a638243000000b0046310d9f150mr7199535pgd.242.1666187262624; Wed, 19 Oct 2022 06:47:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666187262; cv=none; d=google.com; s=arc-20160816; b=qFFdwxRtHBqD3CybOj98ASKIfMiUH+iFy10Ur6WultUfpifQgOihLDReJkQmrsEmVF saD0bzdBCciZ54Y47eTfDzPTXojPd2cSevBTPRJsHpVHjVArG5TQLeI3azZoqoxxqiOx beiTAsjvYJUdTy5r7Yi7ol4y5BBtp9yJ00B1zJI2beT5Giaa9IuFITJ3yrirAHN/cOaW jIAUz9OOgA/1PmYThECJf9wM5XJwUGwunJX04yvvroVzwqz2lKam8vxc/neJbLUlLxiI Uk4pHvZd+aukKIeL8j/qOobmD2Ie6zRiriK12o4EGndRDtGHRqzhhjkO7ZXmnSr5JFN4 hRGA== 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=Pc8WGd+GVorbIbwltJhfFLw7lZ315KJIzaN3YErBcsTJSSR2wy7naXgOXgVyPVnRjA oy/92vEnlJd9+8R+6xkeW9fQzezjQ4xoIipYKX3HYSKNdkkoAlCIGuZEz5CmzAw3xF9s xtMcNO11/Wbhb1OhiQB06FKX+Td0/NJuBEGbsiMxx4u67x389VEXOrqZfrSizPeT5XCx 2SRBx21uS75eDXbSjCFVCALE5lJBtrRz1HUF3GIRUObTNppVQsn4c+E12FCSxQBk7FSQ BrAAw5uYiB/v+BvY4BwtxlqydViOPeQU/a7zLlD1nhVTQAfakwMoK7G6Xml/G8Zz2t2R Mp6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="kp/o175m"; 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 o131-20020a62cd89000000b00565fc1c01c4si18944297pfg.311.2022.10.19.06.47.28; Wed, 19 Oct 2022 06:47:42 -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="kp/o175m"; 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 S233477AbiJSNrK (ORCPT + 99 others); Wed, 19 Oct 2022 09:47:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233251AbiJSNqF (ORCPT ); Wed, 19 Oct 2022 09:46:05 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2112A12FF98; Wed, 19 Oct 2022 06:32:07 -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 sin.source.kernel.org (Postfix) with ESMTPS id 63A77CE2173; Wed, 19 Oct 2022 09:05:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69B73C43470; Wed, 19 Oct 2022 09:05:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170319; bh=MzqN5J3LzkgF+sMfK6atxZHurz4IuMxAyc9YhNaRH90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kp/o175mQ3a1t0UAuuUgZZkHlr9IjmwQslCc+5Pe0elQArsIGRJrGkZFsC4p3x7tL cblJBw+XL4/fZevNg8annbjCc+qq7rOgcmBMLVhZcrWbHLbn7grEVtIfSiLtH41tc8 m6weL3uB6erqdMX2P+2IiYq7x6UV41Qn5wkKXNgc= 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 6.0 611/862] powerpc/powernv: add missing of_node_put() in opal_export_attrs() Date: Wed, 19 Oct 2022 10:31:38 +0200 Message-Id: <20221019083316.921392634@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747123975349376626?= X-GMAIL-MSGID: =?utf-8?q?1747123975349376626?= 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; }