All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH v2] lm-sensors: Fix error seen with
Date: Tue, 19 Oct 2010 18:19:44 +0000	[thread overview]
Message-ID: <20101019181944.GA17399@ericsson.com> (raw)

The following patch fixes an error seen in sensors-detect if i2c bus numbering
is not sequential. Problem is that in this case, $i2c_adapters[] does not exist
for all index values, causing an error message whenever one of the non-existing
objects is accessed.

The error message is:
        Use of uninitialized value in string eq at ./sensors-detect line 5941.

v2: Keep foreach loop. Check if loop object is defined in each iteration.

--
Index: prog/detect/sensors-detect
=================================--- prog/detect/sensors-detect	(revision 5868)
+++ prog/detect/sensors-detect	(working copy)
@@ -5937,6 +5937,7 @@
 	# the adapter drivers so that the numbers will be the same. If not, then
 	# we only load the adapter drivers which are useful.
 	foreach $adap (@i2c_adapters) {
+		next unless defined $adap;
 		next if $adap->{autoload};
 		next if $adap->{driver} eq 'UNKNOWN';
 		next if not defined $configfile and not $adap->{used};

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

             reply	other threads:[~2010-10-19 18:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-19 18:19 Guenter Roeck [this message]
2010-10-19 18:40 ` [lm-sensors] [PATCH v2] lm-sensors: Fix error seen with Jean Delvare
2010-10-19 20:06 ` Guenter Roeck
2010-10-19 20:09 ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101019181944.GA17399@ericsson.com \
    --to=guenter.roeck@ericsson.com \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.