]> Git Repo - linux.git/commitdiff
firmware: dmi: Use the proper accessor for the version field
authorAndy Shevchenko <[email protected]>
Sat, 30 Jul 2022 16:28:46 +0000 (18:28 +0200)
committerJean Delvare <[email protected]>
Sat, 30 Jul 2022 16:28:46 +0000 (18:28 +0200)
The byte at offset 6 represents length. Don't take it and drop it
immediately by using proper accessor, i.e. get_unaligned_be24().

[JD: Change the subject to something less frightening]

Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>
drivers/firmware/dmi_scan.c

index f191a1f901ac70cd7924ec7e62db054f9ff84e85..0eb6b617f709a4ebc181b145d913fc195ecb618f 100644 (file)
@@ -630,7 +630,7 @@ static int __init dmi_smbios3_present(const u8 *buf)
 {
        if (memcmp(buf, "_SM3_", 5) == 0 &&
            buf[6] < 32 && dmi_checksum(buf, buf[6])) {
-               dmi_ver = get_unaligned_be32(buf + 6) & 0xFFFFFF;
+               dmi_ver = get_unaligned_be24(buf + 7);
                dmi_num = 0;                    /* No longer specified */
                dmi_len = get_unaligned_le32(buf + 12);
                dmi_base = get_unaligned_le64(buf + 16);
This page took 0.057578 seconds and 4 git commands to generate.