Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6820952rwi; Mon, 24 Oct 2022 06:33:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM48yprw4AxWyaiRuyJi+JE+NXZDOosPKPCJB26katiI3q/v1ddPCyPlSgVqQzT4CYZGKhd5 X-Received: by 2002:a05:6402:2989:b0:44e:90d0:b9ff with SMTP id eq9-20020a056402298900b0044e90d0b9ffmr30690996edb.110.1666618429179; Mon, 24 Oct 2022 06:33:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618429; cv=none; d=google.com; s=arc-20160816; b=K3qCAe5Fuf4uVERhAaRm5g80CNhumXK1aSTfw+WVQwEDrQGMThLPwCmRWLZYpfaUQz itcQ744v+/+3X62zZVZ3Ry7+IPOTLz2EYbX4Uj4GUSRIxKtuW0xUF2g46+H5uIceeRy/ tq8hjyyfDpxu19LJ8rRTUFzkixxk7xAh8N832tUflHSUSTlqi9BDSoEBBRda2MmzAWqQ 7ZN6zyFbyGQHCQ2vJRSaimYx3vF/u8HMDoc7jfX28ZrS0FBtYLpHXERVkrcYF+tRup+t z8BrEz3ypgpLxV6iB2fIMzTdiCsfiVOUeEyeswg63I44aleR0vHFQhtfmGl5BbY4k9kv DUHw== 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=VEb7XMVehScfgF2EVbSm8qjZcD4RAOy6GM4JdVGyq0o=; b=saI5kDM/EiSxcED+pSkjoaAUySlL74xRUOhVEFR84mmsK49s2zzR0wcePIoI9hZfyO ipMPubA6/QqP4bYqmkAKtUyCUF/zqVFd+kO/VAG1sQ179XKL9AcFunS4x6rH3ksQNfYq REUlm6PhpWy8gjUmdiW6LaBPfQYYCd34a6QMQEHSkrlC3sFh4qaQ9F3nTuNs3stbpt2V Xfpi/kcLow9i8UBdg0160q/MuK0PW6+laAPg7EHmnjMSD194dKRIfVYC5d9ikO3iKZWs /wKXMJPP/dzaxxQUzp5Lg0Yfgt5QJTCjRaW937gsjEgEZDNSFiclUc5juXhbNo2gC2HR NVFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="x5S1Ed/q"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020a056402358700b00451e1aae675si29344519edc.547.2022.10.24.06.33.19; Mon, 24 Oct 2022 06:33:49 -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="x5S1Ed/q"; 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 S232016AbiJXMhU (ORCPT + 99 others); Mon, 24 Oct 2022 08:37:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234483AbiJXMa1 (ORCPT ); Mon, 24 Oct 2022 08:30:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C914038BE; Mon, 24 Oct 2022 05:04:36 -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 0D986B81154; Mon, 24 Oct 2022 11:44:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61EE2C433D7; Mon, 24 Oct 2022 11:44:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611888; bh=PafxsnHxx4dVwa3Z0lxLALA3Rw5PXommpfyQG/T/gxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x5S1Ed/qZDU3RhqRdMbAohunG7U63GUW1TjivY/x1XmWPyJn1HQwZgUXSdM12TkFp joxucFO6/crF/6LGd6fiWesNIVReQbcR02wgWZfFD3CuZcG14/of9Tiz7J1RepmusU B2VSYZ3XjHSgr2VSUQIq3oFTff+RluYZXm9UcHww= 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 4.9 119/159] powerpc/pci_dn: Add missing of_node_put() Date: Mon, 24 Oct 2022 13:31:13 +0200 Message-Id: <20221024112953.844303100@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112949.358278806@linuxfoundation.org> References: <20221024112949.358278806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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 c8f1b78fbd0e..3954e3bb944b 100644 --- a/arch/powerpc/kernel/pci_dn.c +++ b/arch/powerpc/kernel/pci_dn.c @@ -355,6 +355,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); -- 2.35.1