platform/x86: alienware-wmi-wmax: Fix uninitialized bitmap in awcc_hwmon_fans_init()

Initialize fan_temps bitmap to zero before using it for the first time
in each iteration.

Fixes: d699907834 ("platform/x86: alienware-wmi-wmax: Add HWMON support")
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Link: https://lore.kernel.org/r/20250425-temp-id-fix-v1-1-372d71f732bf@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
Kurt Borja 2025-04-25 12:45:06 -03:00 committed by Ilpo Järvinen
parent 317bbe169c
commit 1fe9596a70
No known key found for this signature in database
GPG Key ID: 59AC4F6153E5CE31

View File

@ -1027,6 +1027,8 @@ static int awcc_hwmon_fans_init(struct wmi_device *wdev)
if (ret)
return ret;
bitmap_zero(fan_temps, AWCC_ID_BITMAP_SIZE);
for (j = 0; j < temp_count; j++) {
ret = awcc_get_fan_sensors(wdev, AWCC_OP_GET_FAN_TEMP_ID,
id, j, &temp_id);
@ -1048,8 +1050,6 @@ static int awcc_hwmon_fans_init(struct wmi_device *wdev)
bitmap_gather(gather, fan_temps, priv->temp_sensors, AWCC_ID_BITMAP_SIZE);
bitmap_copy(&fan_data->auto_channels_temp, gather, BITS_PER_LONG);
priv->fan_data[i] = fan_data;
bitmap_zero(fan_temps, AWCC_ID_BITMAP_SIZE);
}
return 0;