Re: [PATCH 1/4] platform/x86: hp-wmi: fix fan table parsing
From: Krishna Chomal
Date: Wed Apr 01 2026 - 08:43:38 EST
On Wed, Apr 01, 2026 at 02:23:31PM +0300, Ilpo Järvinen wrote:
On Wed, 1 Apr 2026, Krishna Chomal wrote:
For Victus S devices, the BIOS fan table header was being incorrectly
parsed as:
struct {
u8 unknown;
u8 num_entries;
}
The first field should be num_fans and the second should be unknown. It
is pure coincidence that interpreting an "unknown" field as "num_entries"
So this coincidence is that both fields happened to contain the same
value? Or (same or) smaller?
Yes, for my board (and for the several recent additions in Victus S list)
the second field in the fan table header happened to match the number of
entries in the table, making the previous implementation appear correct.
However on board 8D87 (and potentially others), the second field contains
a larger value which causes the following check to fail:
if (fan_table->header.num_entries == 0 ||
sizeof(struct victus_s_fan_table_header) +
sizeof(struct victus_s_fan_table_entry) * fan_table->header.num_entries > sizeof(fan_data))
After reverse engineering the Windows implementation, I found that the
official software ignores this second field entirely. Instead it uses
the "stop-at-null" approach implemented in this patch.
--
i.