Commit 4f005551 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Linus Torvalds

[PATCH] I8K: fix /proc reporting of blank service tags

Make /proc/i8k display '?' when service tag is blank in BIOS.
This fixes segfault in i8k gkrellm plugin.
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 44e6f84e
...@@ -99,7 +99,9 @@ struct smm_regs { ...@@ -99,7 +99,9 @@ struct smm_regs {
static inline char *i8k_get_dmi_data(int field) 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) ...@@ -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", return seq_printf(seq, "%s %s %s %d %d %d %d %d %d %d\n",
I8K_PROC_FMT, I8K_PROC_FMT,
bios_version, bios_version,
dmi_get_system_info(DMI_PRODUCT_SERIAL) ? : "N/A", i8k_get_dmi_data(DMI_PRODUCT_SERIAL),
cpu_temp, cpu_temp,
left_fan, right_fan, left_speed, right_speed, left_fan, right_fan, left_speed, right_speed,
ac_power, fn_key); ac_power, fn_key);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment