Commit:     a56bc69a182f501582557af7fad5bc882b1c856c
Parent:     5b1ea82fa245d4be6409cdba7e522ecb0b966b3c
Author:     Michael Ellerman <[EMAIL PROTECTED]>
AuthorDate: Fri Sep 14 15:33:13 2007 +1000
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Oct 12 15:03:17 2007 -0700

    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:
    Signed-off-by: Michael Ellerman <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
 drivers/pci/pci-driver.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 004bc24..c43eced 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)
        if (!dynid)
                return -ENOMEM;
-       INIT_LIST_HEAD(&dynid->node);
        dynid->id.vendor = vendor;
        dynid->id.device = device;
        dynid->id.subvendor = subvendor;
@@ -65,7 +64,7 @@ store_new_id(struct device_driver *driver, const char *buf, 
size_t count)
                driver_data : 0UL;
-       list_add_tail(&pdrv->dynids.list, &dynid->node);
+       list_add_tail(&dynid->node, &pdrv->dynids.list);
        if (get_driver(&pdrv->driver)) {
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to