memory-id: Work-around incorrect "Number of slots"
authorBastien Nocera <hadess@hadess.net>
Mon, 7 Mar 2022 09:11:12 +0000 (10:11 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 9 Mar 2022 23:15:43 +0000 (23:15 +0000)
commit1072a9382b94bacd76decd9cb0ae601ef48e9939
treed6b59c1f36bfca0222f43c0474b5b2389821aec3
parent042bf8d0e6caa31579d92b3a6d0b0d8bedb0889a
memory-id: Work-around incorrect "Number of slots"

In some BIOSes, the "Number of slots or sockets available for Memory
Devices in this array" is incorrectly set to the number of memory array
that's populated.

Work-around this problem by outputting the number of sockets after
having parsed them so that consumers of this data can carry on expecting
an accurate number in this property.

This fixes the number of memory slots advertised for the HP Z600.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1686

(cherry picked from commit d48bf01636d322443f69845da2f40bea70317c92)
src/udev/dmi_memory_id/dmi_memory_id.c
test/dmidecode-dumps/HP-Z600.bin.txt
test/dmidecode-dumps/Lenovo-ThinkPad-X280.bin.txt
test/dmidecode-dumps/Lenovo-Thinkcentre-m720s.bin.txt