* [PATCH] I8K: fix /proc reporting of blank service tags
@ 2005-11-12 5:55 Dmitry Torokhov
0 siblings, 0 replies; only message in thread
From: Dmitry Torokhov @ 2005-11-12 5:55 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Dave Jones, Andrew Morton, LKML
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>
---
drivers/char/i8k.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
Index: work/drivers/char/i8k.c
===================================================================
--- work.orig/drivers/char/i8k.c
+++ work/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
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-11-12 5:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-12 5:55 [PATCH] I8K: fix /proc reporting of blank service tags Dmitry Torokhov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.