diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c index 5e4775a62f6cb25e888299662196b453f902f9b9..08c5179e6d846cdaacbe4207e29534d166e5dcc2 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, 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;