diff options
author | Jean Delvare <khali@linux-fr.org> | 2013-09-11 12:07:25 +0000 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2013-09-11 12:07:25 +0000 |
commit | fbfbb9c9a8620caf4aa0d8ea90b86abd3c189d50 (patch) | |
tree | e2da801712bb522beeb961640819a566c5cdc3dc | |
parent | a3f215218f9b5795188dcda80516c339a94deb3e (diff) | |
download | lm-sensors-git-fbfbb9c9a8620caf4aa0d8ea90b86abd3c189d50.tar.gz |
sensors-detect: Fix use of uninitialized value 'vendor_id' on ppc64
Based on a report and an original patch from Jaromir Capik:
There's no vendor_id entry in the /proc/cpuinfo file in case of PPC64
systems and consequently the script returns 3 screens full of the
following errors:
Use of uninitialized value in string eq at /usr/sbin/sensors-detect
line 6444
Use of uninitialized value in string eq at /usr/sbin/sensors-detect
line 6459
Use of uninitialized value in string eq at /usr/sbin/sensors-detect
line 6473
-rw-r--r-- | CHANGES | 1 | ||||
-rwxr-xr-x | prog/detect/sensors-detect | 5 |
2 files changed, 5 insertions, 1 deletions
@@ -14,6 +14,7 @@ SVN HEAD Introduce automatic mode (--auto) Detect incorrect non-interactive runs Rework option handling + Fix use of uninitialized value 'vendor_id' on ppc64 3.3.4 (2013-05-27) sensors.conf.5: Mention "sensors -u" to get the raw feature names diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index a0f763b2..f12f9837 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -2694,7 +2694,10 @@ sub initialize_cpu_list while (<INPUTFILE>) { if (m/^processor\s*:\s*(\d+)/) { push @cpu, $entry if scalar keys(%{$entry}); # Previous entry - $entry = { nr => $1 }; # New entry + $entry = { # New entry + nr => $1, + vendor_id => "undefined", + }; next; } if (m/^(vendor_id|cpu family|model|model name|stepping|cpuid level)\s*:\s*(.+)$/) { |