]> err.no Git - linux-2.6/commitdiff
[PATCH] I8K: fix /proc reporting of blank service tags
authorDmitry Torokhov <dtor_core@ameritech.net>
Sat, 12 Nov 2005 05:55:15 +0000 (00:55 -0500)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 12 Nov 2005 19:42:32 +0000 (11:42 -0800)
Make /proc/i8k display '?' when service tag is blank in BIOS.
This fixes segfault in i8k gkrellm plugin.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/char/i8k.c

index 6c4b3f986d0ccf26828fe08d61a21810786a6287..f3c3aaf4560e86d07161fb2b8255882c9bf74599 100644 (file)
@@ -99,7 +99,9 @@ struct smm_regs {
 
 static inline char *i8k_get_dmi_data(int field)
 {
-       return dmi_get_system_info(field) ? : "N/A";
+       char *dmi_data = dmi_get_system_info(field);
+
+       return dmi_data && *dmi_data ? dmi_data : "?";
 }
 
 /*
@@ -396,7 +398,7 @@ static int i8k_proc_show(struct seq_file *seq, void *offset)
        return seq_printf(seq, "%s %s %s %d %d %d %d %d %d %d\n",
                          I8K_PROC_FMT,
                          bios_version,
-                         dmi_get_system_info(DMI_PRODUCT_SERIAL) ? : "N/A",
+                         i8k_get_dmi_data(DMI_PRODUCT_SERIAL),
                          cpu_temp,
                          left_fan, right_fan, left_speed, right_speed,
                          ac_power, fn_key);