From patchwork Mon Oct 24 11:31:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9181 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp458274wru; Mon, 24 Oct 2022 06:37:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7furP1gYlc9+F7dklV2MaNu3nAYbW60g40zEFn7V8IAE7YBiA0kYJgmlrnIOj3uQhtpf/w X-Received: by 2002:aa7:d694:0:b0:461:7638:bde5 with SMTP id d20-20020aa7d694000000b004617638bde5mr11822272edr.105.1666618637097; Mon, 24 Oct 2022 06:37:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618637; cv=none; d=google.com; s=arc-20160816; b=JPAiqREYcZ3tV9nVE+s7I/IfSFYhDXTppTctYVdBvUxyRQL/7QXZ9LWCP9Mhi/xs5/ Ekhz5IHu0TYbc3DOb+T79WIO7E3TZHz2bva5x0T8ec0RIg4ap/4IQezzgoG5A24/gXi0 856Le/+B7boXS+pWV7O34NVUHcruEMsxan/y9lbVnjrnqsOZx2EN4TzLPBImtgz7UYCr UKZuP6ZiXQuldvhNKeIo4wPaOSknpG+76P7EcC5AUnlBP/8yeSuGcvcdFjzmxF2TNgmR FDna26NN6J2RAAJf7d1zYOlKV9SIaPg3Rnnw7Ql4+60DGnAuQqkZdqpdV8wvtaeLHet3 5wiQ== 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=J8lrOUq3ePOivxMbmdFPq/raGu4PMS0S74byryGAI6c=; b=HMcVc3PY3lMAKHAbKMQC6zsA/hLgRdLumdUtKg8lmDyYw7n8LZHEurMBWuL9ipHxW3 rmoRLs6qoeI/oFSGfCxVctG2vOfR93TRw3OJPPCvYeecuN6z4QtWygdpnVbLHZwlNNps edNYoCxOiNvYQnEQWv7WVTRXRVPwZXx5E9a0DsVmaZHH4//L/Eq8KHiO5LUukuwm+nHJ Y/wtQwl+deU7YiEAMTOJt9LgTubooUcJ0GS3hE5oYBRFTqgxcva6Db7gNZLXTfQhq1hy QpkpjOlQtlMnmxrht+OO3fY0K8HWpR0HkwFnj/xIUuHoFTa3DN9HYLb9lV5JxpPH17dW JiMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YF3GmO3Y; 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 cs12-20020a0564020c4c00b004618343b140si6410003edb.199.2022.10.24.06.36.43; Mon, 24 Oct 2022 06:37:17 -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=YF3GmO3Y; 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 S231620AbiJXN05 (ORCPT + 99 others); Mon, 24 Oct 2022 09:26:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236056AbiJXNYL (ORCPT ); Mon, 24 Oct 2022 09:24:11 -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 DC8AA88DD2; Mon, 24 Oct 2022 05:30:31 -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 851FA612E4; Mon, 24 Oct 2022 12:27:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 948BEC433C1; Mon, 24 Oct 2022 12:27:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614449; bh=YEZW9YOcl6ne1huyUwW1PkxEEPh/GPoovlTWplHf8eI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YF3GmO3Y2dDMFAccnlKtqwg5lPATtIkUojN8KOhmuAtsPKpFBlqo0o51ZX+dmKlRw XehfYFYFDkpCPwGmjqECdO5ms2nn5Vl/D8qEfVnLxlR+cFTGbi7wdgznrYGQwue0Oh LBSZsCSMyMZCFE466OHIgs9o4C6ZKl6Opr4Kj8fw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Michael Ellerman , Tyrel Datwyler , Sasha Levin , Miaoqian Lin Subject: [PATCH 5.10 266/390] powerpc/pci_dn: Add missing of_node_put() Date: Mon, 24 Oct 2022 13:31:03 +0200 Message-Id: <20221024113034.236546137@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?1747576304166440688?= X-GMAIL-MSGID: =?utf-8?q?1747576304166440688?= From: Liang He [ Upstream commit 110a1fcb6c4d55144d8179983a475f17a1d6f832 ] In pci_add_device_node_info(), use of_node_put() to drop the reference to 'parent' returned by of_get_parent() to keep refcount balance. Fixes: cca87d303c85 ("powerpc/pci: Refactor pci_dn") Co-authored-by: Miaoqian Lin Signed-off-by: Liang He Signed-off-by: Michael Ellerman Reviewed-by: Tyrel Datwyler Link: https://lore.kernel.org/r/20220701131750.240170-1-windhl@126.com Signed-off-by: Sasha Levin --- arch/powerpc/kernel/pci_dn.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c index e99b7c547d7e..b173ba342645 100644 --- a/arch/powerpc/kernel/pci_dn.c +++ b/arch/powerpc/kernel/pci_dn.c @@ -330,6 +330,7 @@ struct pci_dn *pci_add_device_node_info(struct pci_controller *hose, INIT_LIST_HEAD(&pdn->list); parent = of_get_parent(dn); pdn->parent = parent ? PCI_DN(parent) : NULL; + of_node_put(parent); if (pdn->parent) list_add_tail(&pdn->list, &pdn->parent->child_list);