aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@us.ibm.com>2008-08-15 03:40:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-08-15 11:35:44 -0400
commit9c5413eac5199b8457689eb2c9d9e75138356bd6 (patch)
tree74865a1e85daa8e21c140c1ecb1de55fbbb08b50 /drivers/hwmon
parenteb93b7df7e66597fa807e34a0f812ffff7ff165b (diff)
ibmaem: prevent infinite probing loop on x3650 M2 systems
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> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/ibmaem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c
index 5e4775a62f6c..08c5179e6d84 100644
--- a/drivers/hwmon/ibmaem.c
+++ b/drivers/hwmon/ibmaem.c
@@ -676,7 +676,8 @@ static int aem_find_aem2(struct aem_ipmi_data *data,
676 return -ETIMEDOUT; 676 return -ETIMEDOUT;
677 677
678 if (data->rx_result || data->rx_msg_len != sizeof(*fi_resp) || 678 if (data->rx_result || data->rx_msg_len != sizeof(*fi_resp) ||
679 memcmp(&fi_resp->id, &system_x_id, sizeof(system_x_id))) 679 memcmp(&fi_resp->id, &system_x_id, sizeof(system_x_id)) ||
680 fi_resp->num_instances <= instance_num)
680 return -ENOENT; 681 return -ENOENT;
681 682
682 return 0; 683 return 0;