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>
Thu, 10 Mar 2022 12:54:30 +0000 (12:54 +0000)
commitb40dc93bc4f122d3380eca9ee282a980cdfa5a4b
tree68e7f146069baf1505bab2f71724a2c4d17040ae
parente406d65134f8a2d78a5f674a287a073b067c27e8
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)
(cherry picked from commit 1072a9382b94bacd76decd9cb0ae601ef48e9939)
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