Skip to contentSkip to conversation

sensors-detect : Fixing use of uninitialised value 'vendor_id' on ppc64

PATCH In review Jaromir Capik 2 participants 2 messages Sep 10, 2013 – Sep 11, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sensors-detect : Fixing use of uninitialised value 'vendor_id' on ppc64

Hello.

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

The attached patch fixes that.

Please, merge.

Thanks in advance.

Regards,
Jaromir.

--
Jaromir Capik
Red Hat Czech, s.r.o.
Software Engineer / Secondary Arch

Email: [email protected]
Web: www.cz.redhat.com
Red Hat Czech s.r.o., Purkynova 99/71, 612 45, Brno, Czech Republic
IC: 27690016

prog/detect/sensors-detect +1 -0
diff -Naur lm_sensors-3.3.4.orig/prog/detect/sensors-detect lm_sensors-3.3.4/prog/detect/sensors-detect
@@ -2657,6 +2657,7 @@
 		if (m/^processor\s*:\s*(\d+)/) {
 			push @cpu, $entry if scalar keys(%{$entry}); # Previous entry
 			$entry = { nr => $1 }; # New entry
+			$entry->{vendor_id} = "undefined";
 			next;
 		}
 		if (m/^(vendor_id|cpu family|model|model name|stepping|cpuid level)\s*:\s*(.+)$/) {

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#1 lore raw

Hi Jaromir,

Quoted 11 lines · 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

The attached patch fixes that.

Please, merge.

Thanks for reporting. I don't think sensors-detect is terribly useful on PPC64, but the fix is simple enough so can can take it. I have committed a slightly different variant:
http://www.lm-sensors.org/changeset/6196

Thanks for your contribution.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors