forked from mirror/dmidecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dmidecode: Use read_file() to read the DMI table from sysfs
We shouldn't use mem_chunk() to read the DMI table from sysfs. This will fail for SMBIOS v3 implementations which specify a maximum length for the table rather than its exact length. The kernel will trim the table to the actual length, so the DMI file will be shorter than the length announced in entry point. read_file() fits the bill in this case, as it deals with end of file nicely. This also helps with corrupted DMI tables, as the kernel will not export the part of the table that it wasn't able to parse, effectively trimming it. This fixes bug #46176: https://savannah.nongnu.org/bugs/?46176 Unexpected end of file error
- Loading branch information
Showing
2 changed files
with
24 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters