From 81ae37c58709cf1396b09e5136acfc8a0c259476 Mon Sep 17 00:00:00 2001 From: Burt P Date: Tue, 25 Jul 2017 14:33:49 -0500 Subject: device tree: fix crash when device tree is not found * check if device tree was found before add_keys() * UNKIFNULL(model) before strcmp * make UNKIFNULL() STRIFNULL() EMPIFNULL() macros more generic Signed-off-by: Burt P --- includes/cpu_util.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'includes/cpu_util.h') diff --git a/includes/cpu_util.h b/includes/cpu_util.h index 36ca3c2d..da581a78 100644 --- a/includes/cpu_util.h +++ b/includes/cpu_util.h @@ -7,8 +7,7 @@ #define PROC_CPUINFO "/proc/cpuinfo" #endif -/* needs a local Processor *processor */ -#define STRIFNULL(f,cs) if (processor->f == NULL) processor->f = g_strdup(cs); +#define STRIFNULL(f,cs) if (f == NULL) f = g_strdup(cs); #define UNKIFNULL(f) STRIFNULL(f, _("(Unknown)") ) #define EMPIFNULL(f) STRIFNULL(f, "") -- cgit v1.2.3