summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-11-12 00:55:15 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-12 11:42:32 -0800
commit4f005551a8fac21b6fec8d10d57cd12d373d79e1 (patch)
treeda64987344a6d30a80a3bb8fe559ba42951d43b4 /drivers/char
parent44e6f84e3597905816a0440e7218d2ed072120da (diff)
downloadop-kernel-dev-4f005551a8fac21b6fec8d10d57cd12d373d79e1.zip
op-kernel-dev-4f005551a8fac21b6fec8d10d57cd12d373d79e1.tar.gz
[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: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/i8k.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
index 6c4b3f9..f3c3aaf 100644
--- a/drivers/char/i8k.c
+++ b/drivers/char/i8k.c
@@ -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);
OpenPOWER on IntegriCloud