Skip to content

Commit 4a8e04e

Browse files
kuu-rtij-intel
authored andcommitted
platform/x86: alienware-wmi-wmax: Fix uninitialized variable due to bad error handling
wmax_thermal_information() may also return -ENOMSG, which would leave `id` uninitialized in thermal_profile_probe. Reorder and modify logic to catch all errors. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/Z_-KVqNbD9ygvE2X@stanley.mountain Fixes: 27e9e63 ("platform/x86: alienware-wmi: Refactor thermal control methods") Signed-off-by: Kurt Borja <kuurtb@gmail.com> Link: https://lore.kernel.org/r/20250416-smatch-fix-v1-1-35491b462d8f@gmail.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
1 parent 8d6955e commit 4a8e04e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/platform/x86/dell/alienware-wmi-wmax.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,12 +655,10 @@ static int thermal_profile_probe(void *drvdata, unsigned long *choices)
655655
for (u32 i = 0; i < sys_desc[3]; i++) {
656656
ret = wmax_thermal_information(priv->wdev, WMAX_OPERATION_LIST_IDS,
657657
i + first_mode, &out_data);
658-
659-
if (ret == -EIO)
660-
return ret;
661-
662658
if (ret == -EBADRQC)
663659
break;
660+
if (ret)
661+
return ret;
664662

665663
if (!is_wmax_thermal_code(out_data))
666664
continue;

0 commit comments

Comments
 (0)