The BIOS can choose to return no event data in response to a
WMI event, so the ACPI object passed to the WMI notify handler
can be NULL.
Check for such a situation and ignore the event in such a case.
Fixes: 23902f98f8d4 ("hwmon: add HP WMI Sensors driver")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
drivers/hwmon/hp-wmi-sensors.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hwmon/hp-wmi-sensors.c b/drivers/hwmon/hp-wmi-sensors.c
index b5325d0e72b9..dfa1d6926dea 100644
--- a/drivers/hwmon/hp-wmi-sensors.c
+++ b/drivers/hwmon/hp-wmi-sensors.c
@@ -1637,6 +1637,8 @@ static void hp_wmi_notify(u32 value, void *context)
goto out_unlock;
wobj = out.pointer;
+ if (!wobj)
+ goto out_unlock;
err = populate_event_from_wobj(dev, &event, wobj);
if (err) {
--
2.39.2
On Sun, Sep 01, 2024 at 05:10:51AM +0200, Armin Wolf wrote:
> The BIOS can choose to return no event data in response to a
> WMI event, so the ACPI object passed to the WMI notify handler
> can be NULL.
>
> Check for such a situation and ignore the event in such a case.
>
> Fixes: 23902f98f8d4 ("hwmon: add HP WMI Sensors driver")
> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Applied.
Thanks,
Guenter
Hi All,
On 9/2/24 4:28 PM, Guenter Roeck wrote:
> On Sun, Sep 01, 2024 at 05:10:51AM +0200, Armin Wolf wrote:
>> The BIOS can choose to return no event data in response to a
>> WMI event, so the ACPI object passed to the WMI notify handler
>> can be NULL.
>>
>> Check for such a situation and ignore the event in such a case.
>>
>> Fixes: 23902f98f8d4 ("hwmon: add HP WMI Sensors driver")
>> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
>> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
>
> Applied.
Thank you.
Unfortunately patch 2/5 touches the same part of the file,
so I cannot apply the rest of the series without first
bringing this patch into platform-drivers-x86/for-next .
Guenter, can you provide an immutable branch/tag with
this patch on it; or drop this patch that I merge
the entire series through platform-drivers-x86/for-next ?
Regards,
Hans
On 9/4/24 10:55, Hans de Goede wrote:
> Hi All,
>
> On 9/2/24 4:28 PM, Guenter Roeck wrote:
>> On Sun, Sep 01, 2024 at 05:10:51AM +0200, Armin Wolf wrote:
>>> The BIOS can choose to return no event data in response to a
>>> WMI event, so the ACPI object passed to the WMI notify handler
>>> can be NULL.
>>>
>>> Check for such a situation and ignore the event in such a case.
>>>
>>> Fixes: 23902f98f8d4 ("hwmon: add HP WMI Sensors driver")
>>> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
>>> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
>>
>> Applied.
>
> Thank you.
>
> Unfortunately patch 2/5 touches the same part of the file,
> so I cannot apply the rest of the series without first
> bringing this patch into platform-drivers-x86/for-next .
>
> Guenter, can you provide an immutable branch/tag with
> this patch on it; or drop this patch that I merge
> the entire series through platform-drivers-x86/for-next ?
>
Can you wait a couple of days ? Since this is a bug fix, I had
planned to send a pull request either later today or; with that,
the patch would be upstream.
Guenter
Hi Guenter,
On 9/4/24 8:38 PM, Guenter Roeck wrote:
> On 9/4/24 10:55, Hans de Goede wrote:
>> Hi All,
>>
>> On 9/2/24 4:28 PM, Guenter Roeck wrote:
>>> On Sun, Sep 01, 2024 at 05:10:51AM +0200, Armin Wolf wrote:
>>>> The BIOS can choose to return no event data in response to a
>>>> WMI event, so the ACPI object passed to the WMI notify handler
>>>> can be NULL.
>>>>
>>>> Check for such a situation and ignore the event in such a case.
>>>>
>>>> Fixes: 23902f98f8d4 ("hwmon: add HP WMI Sensors driver")
>>>> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
>>>> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
>>>
>>> Applied.
>>
>> Thank you.
>>
>> Unfortunately patch 2/5 touches the same part of the file,
>> so I cannot apply the rest of the series without first
>> bringing this patch into platform-drivers-x86/for-next .
>>
>> Guenter, can you provide an immutable branch/tag with
>> this patch on it; or drop this patch that I merge
>> the entire series through platform-drivers-x86/for-next ?
>>
>
> Can you wait a couple of days ? Since this is a bug fix, I had
> planned to send a pull request either later today or; with that,
> the patch would be upstream.
Yes I can wait a couple of days, thank you.
Regards,
Hans
On 9/4/24 11:42, Hans de Goede wrote:
> Hi Guenter,
>
> On 9/4/24 8:38 PM, Guenter Roeck wrote:
>> On 9/4/24 10:55, Hans de Goede wrote:
>>> Hi All,
>>>
>>> On 9/2/24 4:28 PM, Guenter Roeck wrote:
>>>> On Sun, Sep 01, 2024 at 05:10:51AM +0200, Armin Wolf wrote:
>>>>> The BIOS can choose to return no event data in response to a
>>>>> WMI event, so the ACPI object passed to the WMI notify handler
>>>>> can be NULL.
>>>>>
>>>>> Check for such a situation and ignore the event in such a case.
>>>>>
>>>>> Fixes: 23902f98f8d4 ("hwmon: add HP WMI Sensors driver")
>>>>> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
>>>>> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
>>>>
>>>> Applied.
>>>
>>> Thank you.
>>>
>>> Unfortunately patch 2/5 touches the same part of the file,
>>> so I cannot apply the rest of the series without first
>>> bringing this patch into platform-drivers-x86/for-next .
>>>
>>> Guenter, can you provide an immutable branch/tag with
>>> this patch on it; or drop this patch that I merge
>>> the entire series through platform-drivers-x86/for-next ?
>>>
>>
>> Can you wait a couple of days ? Since this is a bug fix, I had
>> planned to send a pull request either later today or; with that,
>> the patch would be upstream.
>
> Yes I can wait a couple of days, thank you.
>
I sent a pull request, and the patch is already upstream.
Guenter
On Sun, 1 Sep 2024, Armin Wolf wrote:
> The BIOS can choose to return no event data in response to a
> WMI event, so the ACPI object passed to the WMI notify handler
> can be NULL.
>
> Check for such a situation and ignore the event in such a case.
>
> Fixes: 23902f98f8d4 ("hwmon: add HP WMI Sensors driver")
> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
--
i.
> ---
> drivers/hwmon/hp-wmi-sensors.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/hwmon/hp-wmi-sensors.c b/drivers/hwmon/hp-wmi-sensors.c
> index b5325d0e72b9..dfa1d6926dea 100644
> --- a/drivers/hwmon/hp-wmi-sensors.c
> +++ b/drivers/hwmon/hp-wmi-sensors.c
> @@ -1637,6 +1637,8 @@ static void hp_wmi_notify(u32 value, void *context)
> goto out_unlock;
>
> wobj = out.pointer;
> + if (!wobj)
> + goto out_unlock;
>
> err = populate_event_from_wobj(dev, &event, wobj);
> if (err) {
> --
> 2.39.2
>
© 2016 - 2026 Red Hat, Inc.