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>
Mon, 7 Mar 2022 15:33:26 +0000 (15:33 +0000)
commitd48bf01636d322443f69845da2f40bea70317c92
tree4993877461ab8fd5b7c4faaea4fafeb6e1248ee9
parentda637c8fcad1baa530578982d41a6ecb1440f7c5
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
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