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/