]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] DMI: fix DMI onboard device discovery
authorAndrey Panin <pazke@donpac.ru>
Fri, 24 Mar 2006 21:18:52 +0000 (13:18 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 28 Mar 2006 06:47:31 +0000 (22:47 -0800)
Attached patch fixes invalid pointer arithmetic in DMI code to make onboard
device discovery working again.

akpm: bug has been present since dmi_find_device() was added in 2.6.14.
Affects ipmi only (I think) - the symptoms weren't described.

akpm: changed to use pointer arithmetic rather than open-coded sizeof.

Signed-off-by: Andrey Panin <pazke@donpac.ru>
Cc: Corey Minyard <minyard@acm.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/i386/kernel/dmi_scan.c

index 6a93d75db4313a5b3355c0b2896917b13f0c32f8..ca2a0cbcac049883046dc09ba2dd6f0de7c0a9ea 100644 (file)
@@ -106,7 +106,7 @@ static void __init dmi_save_devices(struct dmi_header *dm)
        struct dmi_device *dev;
 
        for (i = 0; i < count; i++) {
-               char *d = ((char *) dm) + (i * 2);
+               char *d = (char *)(dm + 1) + (i * 2);
 
                /* Skip disabled device */
                if ((*d & 0x80) == 0)