mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
smbios: Print an error on unexpected entry point length on identify
This helps figuring out quickly why no SMBIOS device appears in this case. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation (cherry picked from commit fdf08ac1e9f9baac4fcf4af8f3bf7a34d3ea0009)
This commit is contained in:
parent
8c9b142b38
commit
7dffa9db45
1 changed files with 7 additions and 2 deletions
|
|
@ -87,7 +87,7 @@ smbios_identify (driver_t *driver, device_t parent)
|
|||
device_t child;
|
||||
vm_paddr_t addr = 0;
|
||||
size_t map_size = sizeof(*eps);
|
||||
int length;
|
||||
uint8_t length;
|
||||
|
||||
if (!device_is_alive(parent))
|
||||
return;
|
||||
|
|
@ -149,8 +149,13 @@ smbios_identify (driver_t *driver, device_t parent)
|
|||
if (length == 0x1e && map_size == sizeof(*eps) &&
|
||||
eps->major_version == 2 && eps->minor_version == 1)
|
||||
length = map_size;
|
||||
else
|
||||
else {
|
||||
printf("smbios: %s-bit Entry Point: Invalid length: "
|
||||
"Got %hhu, expected %zu\n",
|
||||
map_size == sizeof(*eps3) ? "64" : "32",
|
||||
length, map_size);
|
||||
goto unmap_return;
|
||||
}
|
||||
}
|
||||
|
||||
child = BUS_ADD_CHILD(parent, 5, "smbios", -1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue