Received: by 2002:a05:622a:251a:b0:39a:b4a2:e86 with SMTP id cm26csp3167366qtb; Mon, 24 Oct 2022 07:14:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5+/ylqzP3ICC1O/cBycRDm8BICukYQ84tzCFUnpkNvW1c/PqyRUI5maMeSjMfSIAceLoW1 X-Received: by 2002:a17:906:eecb:b0:73c:5bcb:8eb3 with SMTP id wu11-20020a170906eecb00b0073c5bcb8eb3mr27454542ejb.284.1666620773510; Mon, 24 Oct 2022 07:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666620773; cv=none; d=google.com; s=arc-20160816; b=JqFMwG5EKhtuo8DwYZJ0kBxuvaMG3xBMce8QNQNXDZxy8ljaKAfHMKaPf5baKVFQF0 bdms9fhrXpJelisKXN9j8H4yXI/PTCSyQjthbC9AvmwZYt3amMsMs5haUXNBAP9O54rY w8SOUvul4TXdwZHr7dtVP7nmm6q7EM5XLljFjESyEv14g4NbXohMBM9WjejDMve1Mm0h lr9u+VRE/PP3dtsuzXucT9c2iLhsWVmpZ/kesi7+95V2GDMgjEhoRyxhceWRRGLMGSph bxgw303McRAAMqZHy+jLfMowTX0zXZegIEPAlAgcTHszPOkX8hhlGNTpDVHSvoZkU8G6 ktiw== 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=xPYwQIKXV2kKHhHHARdNSxtrMugLGMCfHihp2/Dvaho=; b=UA9+WhOjhC55gF3IoA1qH/3YtWTUSM+WQvr4EHw+mNdQ49k9/Q91Pi4F0FozpYiGp2 R9tMaKTbxi7vAgeRgkNfZUbNDrcY5GnEfZuduWcDswLsBhltRg6MXfg1YlvTZHZ1WP6L kci5VJ3aMZ/NBEJWUfzsFY8NrDvUpvYi1rKusTuRI5Qy8sGBhtiXunaP6sCK/lApHxra AhLAtF8WH+uGYnCCzWcp/qvpZaA7m57BrR+KvKejR5mjHb7fGFfRSIAvhzTBVQZCZ55N rvPcdu5u0fKxvrZ7U+AuNYtGC31NjJQmeFyCQYz8bzhINzKx/kDnt5XrGAlib2QZXpqr E+dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FaTtIkvZ; 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 hg5-20020a1709072cc500b00780636a4a58si27393326ejc.626.2022.10.24.07.12.28; Mon, 24 Oct 2022 07:12:53 -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=FaTtIkvZ; 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 S234695AbiJXMtT (ORCPT + 99 others); Mon, 24 Oct 2022 08:49:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234445AbiJXMov (ORCPT ); Mon, 24 Oct 2022 08:44:51 -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 6E4FB7D785; Mon, 24 Oct 2022 05:09:04 -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 0658F6129E; Mon, 24 Oct 2022 12:01:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15166C433C1; Mon, 24 Oct 2022 12:01:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612896; bh=hKQiSeCsgWMSlBAR3PYxI/Z9PtWgM478Tkqef9C7Tr8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FaTtIkvZiHYs8ewjetprNS2ICWQanb1JtbuN0VPWz9jkTlT20tgBDPxOxUxrDfNUp GAjdWXTt44FYrDL+LsYdouZGW12T8W+iahIzaCACVNWdm8BiQ26mvFlIi72CmbK8Tc Gh5vxWl6KrNJkbc//HUMHE3cqGWiwd69dsZIEKaU= 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.19 161/229] powerpc/pci_dn: Add missing of_node_put() Date: Mon, 24 Oct 2022 13:31:20 +0200 Message-Id: <20221024113004.203845169@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@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 7cecc3bd953b..bd68c3259fad 100644 --- a/arch/powerpc/kernel/pci_dn.c +++ b/arch/powerpc/kernel/pci_dn.c @@ -338,6 +338,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