Re: [PATCH 2/5] hwmon: (hp-wmi-sensors) Check if WMI event data exists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 22, 2024 at 07:38:07PM +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.
> 
> Signed-off-by: Armin Wolf <W_Armin@xxxxxx>

Acked-by: Guenter Roeck <linux@xxxxxxxxxxxx>

> ---
>  drivers/hwmon/hp-wmi-sensors.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/hwmon/hp-wmi-sensors.c b/drivers/hwmon/hp-wmi-sensors.c
> index 6892518d537c..d6bdad26feb1 100644
> --- a/drivers/hwmon/hp-wmi-sensors.c
> +++ b/drivers/hwmon/hp-wmi-sensors.c
> @@ -1628,6 +1628,9 @@ static void hp_wmi_notify(union acpi_object *wobj, void *context)
>  	 * HPBIOS_BIOSEvent instance.
>  	 */
> 
> +	if (!wobj)
> +		return;
> +
>  	mutex_lock(&state->lock);
> 
>  	err = populate_event_from_wobj(dev, &event, wobj);
> --
> 2.39.2
> 
> 




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux