From: "Darrick J. Wong" <djwong@us.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
lm-sensors <lm-sensors@lm-sensors.org>
Subject: [PATCH] ibmaem: Prevent infinite probing loop on x3650 M2 systems
Date: Wed, 13 Aug 2008 15:40:15 -0700 [thread overview]
Message-ID: <20080813224015.GA28450@tree.beaverton.ibm.com> (raw)
On older machines, probing for a nonexistent AEM interface returned an IPMI
error; when we saw this, we'd stop probing. On the x3650 M2 and (presumably)
later, we are returned a value indicating success and a buffer full of garbage
or zeroes. This causes the probe function to run in an infinite loop. To fix
this, we add one last check--if the interface number we're looking for is
higher than the number of interfaces that AEM claims to have, stop probing.
Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
---
drivers/hwmon/ibmaem.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c
index c1ee7dd..0f70dc2 100644
--- a/drivers/hwmon/ibmaem.c
+++ b/drivers/hwmon/ibmaem.c
@@ -682,7 +682,8 @@ static int aem_find_aem2(struct aem_ipmi_data *data,
return -ETIMEDOUT;
if (data->rx_result || data->rx_msg_len != sizeof(*fi_resp) ||
- memcmp(&fi_resp->id, &system_x_id, sizeof(system_x_id)))
+ memcmp(&fi_resp->id, &system_x_id, sizeof(system_x_id)) ||
+ fi_resp->num_instances <= instance_num)
return -ENOENT;
return 0;
reply other threads:[~2008-08-13 22:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20080813224015.GA28450@tree.beaverton.ibm.com \
--to=djwong@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lm-sensors@lm-sensors.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®