Skip to content

Commit

Permalink
ibmaem: prevent infinite probing loop on x3650 M2 systems
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Darrick J. Wong authored and Linus Torvalds committed Aug 15, 2008
1 parent eb93b7d commit 9c5413e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hwmon/ibmaem.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,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;
Expand Down

0 comments on commit 9c5413e

Please sign in to comment.