From 1fe9596a70d40b017f698db42621ec96da3a0cac Mon Sep 17 00:00:00 2001 From: Kurt Borja Date: Fri, 25 Apr 2025 12:45:06 -0300 Subject: [PATCH] platform/x86: alienware-wmi-wmax: Fix uninitialized bitmap in awcc_hwmon_fans_init() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Initialize fan_temps bitmap to zero before using it for the first time in each iteration. Fixes: d69990783495 ("platform/x86: alienware-wmi-wmax: Add HWMON support") Signed-off-by: Kurt Borja Link: https://lore.kernel.org/r/20250425-temp-id-fix-v1-1-372d71f732bf@gmail.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen --- drivers/platform/x86/dell/alienware-wmi-wmax.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/dell/alienware-wmi-wmax.c b/drivers/platform/x86/dell/alienware-wmi-wmax.c index faeddfe3b79e..27e5b0b23c27 100644 --- a/drivers/platform/x86/dell/alienware-wmi-wmax.c +++ b/drivers/platform/x86/dell/alienware-wmi-wmax.c @@ -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; -- 2.25.1