]> err.no Git - linux-2.6/blobdiff - drivers/hwmon/ibmaem.c
ibmaem: prevent infinite probing loop on x3650 M2 systems
[linux-2.6] / drivers / hwmon / ibmaem.c
index 5e4775a62f6cb25e888299662196b453f902f9b9..08c5179e6d846cdaacbe4207e29534d166e5dcc2 100644 (file)
@@ -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;