[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210825083425.32740-1-yajun.deng@linux.dev>
Date: Wed, 25 Aug 2021 16:34:25 +0800
From: Yajun Deng <yajun.deng@...ux.dev>
To: bhelgaas@...gle.com, arnd@...db.de, robh@...nel.org,
lorenzo.pieralisi@....com
Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
Yajun Deng <yajun.deng@...ux.dev>
Subject: [PATCH linux-next] PCI: Fix the order in unregister path
device_del() should be called first and then called put_device() in
unregister path, becase if that the final reference count, the device
will be cleaned up via device_release() above. So use device_unregister()
instead.
Fixes: 9885440b16b8 (PCI: Fix pci_host_bridge struct device release/free handling)
Signed-off-by: Yajun Deng <yajun.deng@...ux.dev>
---
drivers/pci/probe.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 0ec5c792c27d..abd481a15a17 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -994,9 +994,7 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)
return 0;
unregister:
- put_device(&bridge->dev);
- device_del(&bridge->dev);
-
+ device_unregister(&bridge->dev);
free:
kfree(bus);
return err;
--
2.32.0
Powered by blists - more mailing lists