Commit:     43fe105a5c91b2f00ea7f900ed307fe980410612
Parent:     79306a340c23e40c94ce16e504d172ae15b24187
Author:     Jean Delvare <[EMAIL PROTECTED]>
AuthorDate: Sat Feb 23 15:23:55 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Sat Feb 23 17:12:15 2008 -0800

    dmi: prevent linked list corruption
    Adding the same item to a given linked list more than once is guaranteed
    to break and corrupt the list.  This is however what we do in dmi_scan
    since commit 79da4721117fcf188b4b007b775738a530f574da ("x86: fix DMI out
    of memory problems").
    Given that there is absolutely no interest in saving empty OEM strings
    anyway, I propose the simple and efficient fix below: we discard the empty
    OEM strings altogether.
    Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
    Acked-by: Parag Warudkar <[EMAIL PROTECTED]>
    Cc: Ingo Molnar <[EMAIL PROTECTED]>
    Cc: Thomas Gleixner <[EMAIL PROTECTED]>
    Cc: Matt Domsch <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 drivers/firmware/dmi_scan.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index de30275..4072449 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -217,10 +217,6 @@ static void __init dmi_save_devices(const struct 
dmi_header *dm)
-static struct dmi_device empty_oem_string_dev = {
-       .name = dmi_empty_string,
 static void __init dmi_save_oem_strings_devices(const struct dmi_header *dm)
        int i, count = *(u8 *)(dm + 1);
@@ -229,10 +225,8 @@ static void __init dmi_save_oem_strings_devices(const 
struct dmi_header *dm)
        for (i = 1; i <= count; i++) {
                char *devname = dmi_string(dm, i);
-               if (!strcmp(devname, dmi_empty_string)) {
-                       list_add(&empty_oem_string_dev.list, &dmi_devices);
+               if (devname == dmi_empty_string)
-               }
                dev = dmi_alloc(sizeof(*dev));
                if (!dev) {
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