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 = {