Re: [PATCH] PCI and PCI Hotplug changes and fixes for 2.5.70

From: Greg KH (greg@kroah.com)
Date: Wed Jun 04 2003 - 21:05:46 EST


ChangeSet 1.1229.25.2, 2003/05/28 16:37:35-05:00, Matt_Domsch@dell.com

dynids: free dynids on driver unload

 drivers/pci/pci-driver.c | 17 +++++++++++++++++
 1 files changed, 17 insertions(+)

diff -Nru a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
--- a/drivers/pci/pci-driver.c Wed Jun 4 18:12:25 2003
+++ b/drivers/pci/pci-driver.c Wed Jun 4 18:12:25 2003
@@ -315,6 +315,22 @@
         INIT_LIST_HEAD(&dynids->list);
 }
 
+static void
+pci_free_dynids(struct pci_driver *drv)
+{
+ struct list_head *pos, *n;
+ struct dynid *dynid;
+
+ spin_lock(&drv->dynids.lock);
+ list_for_each_safe(pos, n, &drv->dynids.list) {
+ dynid = list_entry(pos, struct dynid, node);
+ list_del(&dynid->node);
+ kfree(dynid);
+ }
+ spin_unlock(&drv->dynids.lock);
+}
+
+
 /**
  * pci_register_driver - register a new pci driver
  * @drv: the driver structure to register
@@ -363,6 +379,7 @@
 pci_unregister_driver(struct pci_driver *drv)
 {
         driver_unregister(&drv->driver);
+ pci_free_dynids(drv);
 }
 
 static struct pci_driver pci_compat_driver = {

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jun 07 2003 - 22:00:26 EST