aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/dmi_scan.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-04 20:36:14 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-04 20:36:14 -0400
commit5b146f7e016a8727a98b3d48e4f4e128d3624cd5 (patch)
tree308acba9e7fdb00ab1458ebacd25dd049e310996 /drivers/firmware/dmi_scan.c
parent626f090c5cbbe557379978c7a9525011ad7fbbf6 (diff)
parentc095ba7224d8edc71dcef0d655911399a8bd4a3f (diff)
Merge 3.11-rc4 into usb-next
We want those fixes in here also. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/firmware/dmi_scan.c')
-rw-r--r--drivers/firmware/dmi_scan.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index eb760a218da4..232fa8fce26a 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -419,6 +419,13 @@ static void __init dmi_format_ids(char *buf, size_t len)
419 dmi_get_system_info(DMI_BIOS_DATE)); 419 dmi_get_system_info(DMI_BIOS_DATE));
420} 420}
421 421
422/*
423 * Check for DMI/SMBIOS headers in the system firmware image. Any
424 * SMBIOS header must start 16 bytes before the DMI header, so take a
425 * 32 byte buffer and check for DMI at offset 16 and SMBIOS at offset
426 * 0. If the DMI header is present, set dmi_ver accordingly (SMBIOS
427 * takes precedence) and return 0. Otherwise return 1.
428 */
422static int __init dmi_present(const u8 *buf) 429static int __init dmi_present(const u8 *buf)
423{ 430{
424 int smbios_ver; 431 int smbios_ver;
@@ -506,6 +513,13 @@ void __init dmi_scan_machine(void)
506 if (p == NULL) 513 if (p == NULL)
507 goto error; 514 goto error;
508 515
516 /*
517 * Iterate over all possible DMI header addresses q.
518 * Maintain the 32 bytes around q in buf. On the
519 * first iteration, substitute zero for the
520 * out-of-range bytes so there is no chance of falsely
521 * detecting an SMBIOS header.
522 */
509 memset(buf, 0, 16); 523 memset(buf, 0, 16);
510 for (q = p; q < p + 0x10000; q += 16) { 524 for (q = p; q < p + 0x10000; q += 16) {
511 memcpy_fromio(buf + 16, q, 16); 525 memcpy_fromio(buf + 16, q, 16);