From patchwork Mon Oct 24 11:31:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8645 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp421462wru; Mon, 24 Oct 2022 05:20:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Th7Jr9ansIz8FXZmhvVZ+qaq6F55wrBnQA2samTOixcajGEdwwLP/+R0nPudY8k0dHapd X-Received: by 2002:a17:90b:3847:b0:20d:c41f:de7a with SMTP id nl7-20020a17090b384700b0020dc41fde7amr57331893pjb.85.1666614024445; Mon, 24 Oct 2022 05:20:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666614024; cv=none; d=google.com; s=arc-20160816; b=UHGqZugGXjkNzmWWahcCE1HmDtMGc4JDal3tcHK7I79tAwWzCbDULduFIVTfgUhKXW ANyTL9sCfiL3SEXtUo7McormVuSzCKoITIDM9KyP9CSRSG+oX58AUDU21qrK1ER0z2NY 5lBKdPzjesJ9akCWlKzOHSbbKF5IuZ66Kxxm6OPID3yoqNucrxay4mEordT7zXw20wCt LSWMb/p7e3q75pOW53+ee4C8teCQdp/3oWhLx++SAg/EvnMxumAqhtBHPrFZSRDWZj5y QBoGgKJd2ExcwOeX9d/q6yP+MdSmDmcrpl+Rf0G8VOpt1opyBqvtyVRaaXZeH/PAhX2p ciyw== 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=auTmQHHrGSpjwcVb6FYNCYQDEc0G+haYVXxuYHl0RzI=; b=yg17yuo1PEIbCHVRxsyPIlN2KFPp/tZ/KQWtNZ3Kn+cxvvgTEdypHtR+k5bYSnxscw x7XfWkOMjoyThTrlGyMyNC5nXygMt5JUZfh+54oP1UC0COOFPhctuMbeSe22dCoES/XR qLY0d6ZDH6P5CINfWDgX7cwfXzSl/k3//McS68rH1OV868p0uunvXDqUr4jISwqxrCjb CO2U1Bd+r1iq9BYDR+NixCs6CE21kL1Fty+Bpzfku+Ot8Kezkwksn3f3w56rYoTDiDA+ b7ltO319dc1eB5GHF8Y67v2vMGeeKYDMPzHji2GkwsVOZRbetQNpbaR+yblIm0B354c5 /nLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="KqA7zQO/"; 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 g6-20020a656cc6000000b0041b7be8ef1csi34833024pgw.219.2022.10.24.05.20.10; Mon, 24 Oct 2022 05:20:24 -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="KqA7zQO/"; 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 S232866AbiJXMMU (ORCPT + 99 others); Mon, 24 Oct 2022 08:12:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232851AbiJXMLV (ORCPT ); Mon, 24 Oct 2022 08:11:21 -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 D9A6A804A4; Mon, 24 Oct 2022 04:53:44 -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 27602B81199; Mon, 24 Oct 2022 11:52:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8713DC433C1; Mon, 24 Oct 2022 11:52:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612323; bh=cVhhmhyue59m5yNPy7N779FKJdt+vjkUP23f1DN/X/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KqA7zQO/XDhvid3CIEb8HqpV4zh++aoOhRXJhkQlZS6BtJpexIjOSDMTPrBNxxUIq RS+aoLfn+10+Dl+vNeXY6f54C/ABuZeqQOIa7vewEs/IyGv00CAQpWPfz/ruVnVW4O W0DsYlrNHUSIx45lkUu/OBQZRZOKVLvJnsIXbumM= 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.14 154/210] powerpc/pci_dn: Add missing of_node_put() Date: Mon, 24 Oct 2022 13:31:11 +0200 Message-Id: <20221024113001.980834175@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@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?1747571467170645231?= X-GMAIL-MSGID: =?utf-8?q?1747571467170645231?= 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 0e45a446a8c7..45aa39d55f91 100644 --- a/arch/powerpc/kernel/pci_dn.c +++ b/arch/powerpc/kernel/pci_dn.c @@ -344,6 +344,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);