X86 platform drivers
 help / color / mirror / Atom feed
From: Kurt Borja via B4 Relay <devnull+kuurtb.gmail.com@kernel.org>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Armin Wolf" <W_Armin@gmx.de>
Cc: platform-driver-x86@vger.kernel.org, Dell.Client.Kernel@dell.com,
	 linux-kernel@vger.kernel.org, Kurt Borja <kuurtb@gmail.com>
Subject: [PATCH 1/2] platform/x86: alienware-wmi-wmax: Fix uninitialized bitmap in awcc_hwmon_fans_init()
Date: Fri, 25 Apr 2025 12:45:06 -0300	[thread overview]
Message-ID: <20250425-temp-id-fix-v1-1-372d71f732bf@gmail.com> (raw)
In-Reply-To: <20250425-temp-id-fix-v1-0-372d71f732bf@gmail.com>

From: Kurt Borja <kuurtb@gmail.com>

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 <kuurtb@gmail.com>
---
 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 faeddfe3b79e0aa51e7c8c6b23aa4ac5c7218706..27e5b0b23c27356cd5d72dbc5d3b5b4bdb03e8af 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.49.0



  reply	other threads:[~2025-04-25 15:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-25 15:45 [PATCH 0/2] platform/x86: alienware-wmi-wmax: Fix unitialized variables in awcc_hwmon_fans_init() Kurt Borja via B4 Relay
2025-04-25 15:45 ` Kurt Borja via B4 Relay [this message]
2025-04-25 15:45 ` [PATCH 2/2] platform/x86: alienware-wmi-wmax: Fix awcc_hwmon_fans_init() label logic Kurt Borja via B4 Relay
2025-04-29 14:12 ` [PATCH 0/2] platform/x86: alienware-wmi-wmax: Fix unitialized variables in awcc_hwmon_fans_init() Ilpo Järvinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250425-temp-id-fix-v1-1-372d71f732bf@gmail.com \
    --to=devnull+kuurtb.gmail.com@kernel.org \
    --cc=Dell.Client.Kernel@dell.com \
    --cc=W_Armin@gmx.de \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=kuurtb@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox