Message ID | 20241028084644.3778081-1-peng.fan@oss.nxp.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2EA1FD13588 for <linux-arm-kernel@archiver.kernel.org>; Mon, 28 Oct 2024 08:38:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=CdKN01otIPtYnUlNZixtRpQ6M8UKXznu+NMlgwDFpnM=; b=rDgyUZv9jObb813izk6vDvch+V drAhDmqovQQ+KMOtE+oVwsB+v4M+QuTOjl8GhM7di3RzcwsOTLIH+L9Rtz7Jzdsds98T7Fi5f0705 MGnFFJo7A6ZQ50SSo128UTsf/XDL7W8yabK3tMWMKfV20GXTu4L0/JSMTBCdUXS6T+dUhxn2MLxDi 4ogjfHOPRK8HqYWjHewt5EizQVEsQZdj5bmt/uXT4oDgwPZAG8wWZl4OwHqRGPVxppJ6WPzntPp7A vSeWt60BUNG/4HLQsuMEz3nfGEb52bFkN32t6aNPQzWkbyvAMWcmq3b1qWsAhNdhRF2z2r0OCQh/w nK3EpzSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t5LGd-0000000A7QP-1iKJ; Mon, 28 Oct 2024 08:38:27 +0000 Received: from mail-vi1eur05on20620.outbound.protection.outlook.com ([2a01:111:f403:2613::620] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t5LF2-0000000A7Cz-2msG for linux-arm-kernel@lists.infradead.org; Mon, 28 Oct 2024 08:36:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KzZxsbc+xTNqYoAqZhwA4ZuOATm85l/vnHbOmqzdy1YEEpKB2s0kNOg4buLdCiVhr34iXCbBWVBKQ+UojLqyiAP/ogEA6/YIFPynHD9w5gX3zl1E2VaPJg4A1AB/TY5KCiK6/hxxY7DDyMCpc5wXZjpweFCFcvoLB6gxixCVssomvb0fIqRBXKK3Vc7Ad0FabYcJf/oPPlc4U2iKwdJamFGTpKSB83WQYqr2HAX6Ar2C24N7gneXxNwKhhWip7EhAxsiYKaoaIx2blDAeFsh8/w//ToreTul/svvftWljCOYrGALdWlI38pb3Ms+8y7FtytQSbcTpldvSJh9u3+pjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CdKN01otIPtYnUlNZixtRpQ6M8UKXznu+NMlgwDFpnM=; b=rrfoppTBK9Mam7IvOG7oGYX56OPMHuU53FMFpDQO6rXpOR7yeRSgHMUxylsYQ6jWhpXXC+aiUr8tSUmIaygwQTSLAWIjHT2to8l+Oy5rTSYR+M+uBdan13iJwIoU+xLXM+ob+Hr0briloeJoiDdHGBABZHvvibe1AG1oEqxNiO2HksvsaiigAs9EDQHeGX9gYSqqzKtjzRmH/U7nbthPl8ntswbDk4vWqYMFFHa9l2AhevvrATVQnl3SW3jYbihb+MPLlICCvxnaUkusYeZ4vUwQfwhMQMKKE+OMMd+JCR3jSPIbF4GOBSaPD84MNSD21UBv7LScj+VIKbAWjPOuqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CdKN01otIPtYnUlNZixtRpQ6M8UKXznu+NMlgwDFpnM=; b=pl+hDZDov9jQyBDyaIFoIbQJPD0NnfyJjQfEuW9zYzLoIAQ6kpufamK2LQerwrw4aFs6Pg40SB4kXdfKM61XTa1SPQQNwLjnLaX5vbJdxejAQHH1bRrlsgEv4xx8CzJmwt4LcoRYF4GWLdH64IYrlp3Hwcr1nFmQ4sEpefhM94+zY6Hqc/LNr8wXmEcvW78DFw+Tq+wStgiM8t5qdm/NHkYTXVMjjhJr7ZKxwYvXnOLd3SibZmudioDSAzRaai/XlY9X4Vy3b+ghf7yoJWhZKJ9tqc2O1rw9v3oextudYcYwLiIKA8wzDkAOjCopxWtYbTmXD4ui5DzPW9AfTd720w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by VI0PR04MB10758.eurprd04.prod.outlook.com (2603:10a6:800:25c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Mon, 28 Oct 2024 08:36:40 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%6]) with mapi id 15.20.8093.024; Mon, 28 Oct 2024 08:36:40 +0000 From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com> To: Will Deacon <will@kernel.org>, Lorenzo Pieralisi <lpieralisi@kernel.org>, =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= <kw@linux.com>, Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>, Rob Herring <robh@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, =?utf-8?q?Pali_Roh=C3=A1r?= <pali@kernel.org>, linux-pci@vger.kernel.org (open list:PCI DRIVER FOR GENERIC OF HOSTS), linux-arm-kernel@lists.infradead.org (moderated list:PCI DRIVER FOR GENERIC OF HOSTS), linux-kernel@vger.kernel.org (open list) Cc: Peng Fan <peng.fan@nxp.com> Subject: [PATCH] PCI: check bridge->bus in pci_host_common_remove Date: Mon, 28 Oct 2024 16:46:43 +0800 Message-Id: <20241028084644.3778081-1-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI1PR02CA0056.apcprd02.prod.outlook.com (2603:1096:4:1f5::7) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|VI0PR04MB10758:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b260693-9cca-47de-558e-08dcf72ba4b3 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|52116014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: SK+KUEoMhIll1rQVg8zc6E5SCxxaGgEDCMWHa7zURmvs8ztFlTgbzAzE/bNn42/mMgr6O9wfXurIX1LixYnpEXA1w4qZ7bI898WLsYAe98dm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4yGNfvG7hHrSAd9ZPXxsK5CHng0Ud9G8vcwZrP+X8O0Mncv5I31Rjbo3LuNj7Lko4zD9yAWnlpFRk3uUQ993mXp2hp66L+SF770QXhJVor54etpdjMIqadEeQ38X+UBuDEEWKahUE7SNPxWhX9aaw3W/cNHu5Hdh4SxKYKCTEf4W7S7m8jt0BIxTiONRzakKZpB0x87PSpOe3Bh/ZnwOXxoeS83Gmk1ENfOHwLE9WJ5KZP8xSoXNYkQthFjm167Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8459.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(52116014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4ADW8Gt8+ZcRP2rIsUfL9dcV8ASo0POK8moZbRyhCx+iKI8oak+nnLqDy3TSFBVjVO8i/hoobIpd46DT+z1OzxKzX4KPtDTNaD8drPqAcOz4xlO5Y7thYkOoFSVBDij8QAgvye0CMNrctTC0FyjFAK0lFZ088kPzuNC8rQS9tHTYcZYx8g2XFa/MlezBAHULGSwtTRq/CEQlCGYCXw3BDAHhlivi+vpueRZCUXMlrcrUWUpi+w8mZfZLnGIusThR4axqw20ogdotDsAANQgwndi0d23F9KDO2GbuAhC7Lwdp8zsciSq8mvNcXDbAdlyROFBmwvXaJh+Zisos7UzBSIrBHqtyha8IwGPYhKysZiVwlJdOvOiFG9woCQ6xGA2JwyXhzZIq5lfKtWo5DIx8FfRHx0AA2u1dUfVi4TBJn9oQtcQPudKkP0WaWqEDgQoWh7k1AmDkm+/ri2OZMWlBVojoJXgMd8IA4MBxoFQ48iqDTiPBX4YHBwN87REzHgCIKWZLYe8BoPTe9PfLzE4kxvFd8NCX/3lHWllBbuINRrbdG5cUIVScJ8P/QGmD0DFr9KXKxZA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08dcf72ba4b3 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2024 08:36:40.3322 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kE6BmlKnws0HJRKoV4+fbaHzsbUNs8+2333ZgRvxhcaDcCBmxxNCBpmntBPrEtSHdKQwskrWBdHCKFAeenbOVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR04MB10758 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241028_013648_767374_5E53A745 X-CRM114-Status: GOOD ( 13.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
PCI: check bridge->bus in pci_host_common_remove
|
expand
|
diff --git a/drivers/pci/controller/pci-host-common.c b/drivers/pci/controller/pci-host-common.c index cf5f59a745b3..5a9c29fc57cd 100644 --- a/drivers/pci/controller/pci-host-common.c +++ b/drivers/pci/controller/pci-host-common.c @@ -86,8 +86,10 @@ void pci_host_common_remove(struct platform_device *pdev) struct pci_host_bridge *bridge = platform_get_drvdata(pdev); pci_lock_rescan_remove(); - pci_stop_root_bus(bridge->bus); - pci_remove_root_bus(bridge->bus); + if (bridge->bus) { + pci_stop_root_bus(bridge->bus); + pci_remove_root_bus(bridge->bus); + } pci_unlock_rescan_remove(); } EXPORT_SYMBOL_GPL(pci_host_common_remove);