Commit 74c34e68 authored by Andrey Panin's avatar Andrey Panin Committed by Greg Kroah-Hartman

[PATCH] DMI: 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: default avatarAndrey Panin <pazke@donpac.ru>
Cc: Corey Minyard <minyard@acm.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a0049f93
...@@ -106,7 +106,7 @@ static void __init dmi_save_devices(struct dmi_header *dm) ...@@ -106,7 +106,7 @@ static void __init dmi_save_devices(struct dmi_header *dm)
struct dmi_device *dev; struct dmi_device *dev;
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
char *d = ((char *) dm) + (i * 2); char *d = (char *)(dm + 1) + (i * 2);
/* Skip disabled device */ /* Skip disabled device */
if ((*d & 0x80) == 0) if ((*d & 0x80) == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment