aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-09-14 01:33:13 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 18:03:17 -0400
commita56bc69a182f501582557af7fad5bc882b1c856c (patch)
tree052d752634d36fc4997c7224cd9a546497c19490
parent5b1ea82fa245d4be6409cdba7e522ecb0b966b3c (diff)
PCI: Fix incorrect argument order to list_add_tail() in PCI dynamic ID code
The code for dynamically assigning new ids to PCI drivers, store_new_id(), calls list_add_tail() with the list head and new node arguments in reversed order. The result is that every new id written essentially overwrites the previous list of ids. Caught with the help of Rusty's "horribly bad" list_node patch: http://lkml.org/lkml/2007/6/10/10 Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/pci/pci-driver.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 004bc2487270..c43ecedce673 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -54,7 +54,6 @@ store_new_id(struct device_driver *driver, const char *buf, size_t count)
54 if (!dynid) 54 if (!dynid)
55 return -ENOMEM; 55 return -ENOMEM;
56 56
57 INIT_LIST_HEAD(&dynid->node);
58 dynid->id.vendor = vendor; 57 dynid->id.vendor = vendor;
59 dynid->id.device = device; 58 dynid->id.device = device;
60 dynid->id.subvendor = subvendor; 59 dynid->id.subvendor = subvendor;
@@ -65,7 +64,7 @@ store_new_id(struct device_driver *driver, const char *buf, size_t count)
65 driver_data : 0UL; 64 driver_data : 0UL;
66 65
67 spin_lock(&pdrv->dynids.lock); 66 spin_lock(&pdrv->dynids.lock);
68 list_add_tail(&pdrv->dynids.list, &dynid->node); 67 list_add_tail(&dynid->node, &pdrv->dynids.list);
69 spin_unlock(&pdrv->dynids.lock); 68 spin_unlock(&pdrv->dynids.lock);
70 69
71 if (get_driver(&pdrv->driver)) { 70 if (get_driver(&pdrv->driver)) {