summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2019-06-30 11:00:53 -0500
committerLeandro A. F. Pereira <leandro@hardinfo.org>2019-07-02 17:36:25 -0700
commitb2d4e1ffeac40884fe3b2c979eb2a73aa21b5156 (patch)
tree63101b38c4540b07f8b307e94fa46d12892f2426
parent2ed06303400d985cac80e2bab9d95a3f57c3e924 (diff)
Memory devices: also ignore "Unknown" for DMI manufacturer
Signed-off-by: Burt P <pburt0@gmail.com>
-rw-r--r--modules/devices/dmi_memory.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/devices/dmi_memory.c b/modules/devices/dmi_memory.c
index ad200875..a24fbdd7 100644
--- a/modules/devices/dmi_memory.c
+++ b/modules/devices/dmi_memory.c
@@ -234,11 +234,9 @@ dmi_mem_socket *dmi_mem_socket_new(unsigned long h) {
s->rank = dmidecode_match("Rank", &dtm, &h);
s->mfgr = dmidecode_match("Manufacturer", &dtm, &h);
- if (g_str_has_prefix(s->mfgr, unknown_mfgr_str)) {
- /* the manufacturer code is unknown to dmidecode */
- g_free(s->mfgr);
- s->mfgr = NULL;
- }
+ STR_IGNORE(s->mfgr, unknown_mfgr_str);
+ STR_IGNORE(s->mfgr, "Unknown");
+
null_if_empty(&s->mfgr);
null_if_empty(&s->partno);