From: Andrey Panin Date: Sat, 25 Mar 2006 11:06:31 +0000 (-0800) Subject: [PATCH] fix DMI onboard device discovery X-Git-Tag: v2.6.17-rc1~863 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc83455bc8336f57cd74d6e86b0f8fcad187d179;p=linux-2.6 [PATCH] fix DMI onboard device discovery 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 Cc: Corey Minyard Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c index 6a93d75db4..ca2a0cbcac 100644 --- a/arch/i386/kernel/dmi_scan.c +++ b/arch/i386/kernel/dmi_scan.c @@ -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)