From patchwork Sat Oct 22 07:26:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7591 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1106318wrr; Sat, 22 Oct 2022 01:37:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6apaVPmv7YK2MJnNcE9ltNJIsqJ7uU4EK8+7LENltOGL5bP4Gmq/wxBooTKol3IhrlFIHT X-Received: by 2002:a63:f91e:0:b0:456:ccc4:85c2 with SMTP id h30-20020a63f91e000000b00456ccc485c2mr19358141pgi.624.1666427850057; Sat, 22 Oct 2022 01:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427850; cv=none; d=google.com; s=arc-20160816; b=dmBS36cjjTbT1RUk0rWTf1JgRkJGsp1TC+ELMc1AC6JnVah8NbmjuqBsp2zIH9JV46 4Ioq0xGP2oqEAOnRhlkTQ1N2NLSwLCn/tbUW0U9rAv+sS1Rb8w0d2RfN7raNK9ZVjEYD +J5/9wsisD+WfA1cuXKALh8/YaQtFH0w936O6xJrbRdPfi5ZdTFr1iFIenDmwSkf6PU/ 4aFJRIr1sKTYviqUvBpDuJ3fyXVrS/2fM8PBXEgiJaRqyNJP4OvwVzN9k+VkRWo3RX5m KuvYYx54rOIdiGZgcPJHYTqyUcBb6+F4SOLr6ZScu6BSZdt71viziLTTxwGH7P2qMMIq 1Thw== 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=c158FeTc6/i7JKDsfCRcTrft+Z3vhDrbM/ojlGmUDYI=; b=wVTje7AH3FxU1GvfAs7jDTEAjk/vLqNcr0XDI/bTHjx8E1nPSRN9oE0eBqEP3uQnST 9Dgxq0s7ul1dO1OnDl+ELjBoKjIP/67V2eVFpaXU/e7TbPQjprJtkpKaR8DFNFZN0N12 7h8FUKB1Nl52HlInQDSsbZcVBvKULairI9bHcEWJe23cIOAgqjP0H6lEgEOIYIGMFw9p i5F6iHIPEPs9AEDv/u1q77Ws7fqm0nRg3DsLie0Kz5nwFwmpvu0yvTR9zREg9YWanDPP EQ+n8qPHyabgd3rDE2jtyWDgZM69XhVgolATOQtODVYzd+WHBRgjWsHG4cWoiJH6RF9F tz7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WAAZodWh; 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 mw16-20020a17090b4d1000b0021071bf8d26si10716855pjb.29.2022.10.22.01.37.15; Sat, 22 Oct 2022 01:37:30 -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=WAAZodWh; 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 S233755AbiJVIXt (ORCPT + 99 others); Sat, 22 Oct 2022 04:23:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233630AbiJVIWK (ORCPT ); Sat, 22 Oct 2022 04:22:10 -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 6FBEC7295E; Sat, 22 Oct 2022 00:59: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 ams.source.kernel.org (Postfix) with ESMTPS id AE057B80E4D; Sat, 22 Oct 2022 07:58:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CD3AC433C1; Sat, 22 Oct 2022 07:58:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425515; bh=b7LpL8C/41SiR/ZzlbJOp5syACJkyE/krPpmkVYkMlw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WAAZodWhLV7K97IvJJhnH8VWYkH4RmP02NUOsku3sevSvEjGoSAF5G635ZYJ/lmLv HvQ6dcfnXlNzsjKiLZBPomDfDGS1c07YMjwcpMJDG355TOPGL04JMsl/J0DLCAwWlt BzFzTmOCM/H7RCUiumnlfA1K9g3stFPkTcbRkq54= 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.19 496/717] powerpc/pci_dn: Add missing of_node_put() Date: Sat, 22 Oct 2022 09:26:15 +0200 Message-Id: <20221022072520.200835290@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747376249317701415?= X-GMAIL-MSGID: =?utf-8?q?1747376249317701415?= 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 938ab8838ab5..aa221958007e 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);