OSDN Git Service

platform/x86: hp-wmi: Changing bios_args.data to be dynamically allocated
authorJorge Lopez <jorge.lopez2@hp.com>
Thu, 10 Mar 2022 21:08:53 +0000 (15:08 -0600)
committerHans de Goede <hdegoede@redhat.com>
Tue, 15 Mar 2022 09:49:37 +0000 (10:49 +0100)
commit4b4967cbd2685f313411e6facf915fb2ae01d796
tree298862ed4cc67f04aaaef39b432f3ff525b03288
parentbe9d73e64957bbd31ee9a0d11adc0f720974c558
platform/x86: hp-wmi: Changing bios_args.data to be dynamically allocated

The purpose of this patch is to remove 128 bytes buffer limitation
imposed in bios_args structure.

A limiting factor discovered during this investigation was the struct
bios_args.data size restriction.  The data member size limits all
possible WMI commands to those requiring buffer size of 128 bytes or
less. Several WMI commands and queries require a buffer size larger
than 128 bytes hence limiting current and feature supported by the
driver. It is for this reason, struct bios_args.data changed and is
dynamically allocated.  hp_wmi_perform_query function changed to
handle the memory allocation and release of any required buffer size.

All changes were validated on a HP ZBook Workstation notebook,
HP EliteBook x360, and HP EliteBook 850 G8.  Additional
validation was included in the test process to ensure no other
commands were incorrectly handled.

Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com>
Link: https://lore.kernel.org/r/20220310210853.28367-5-jorge.lopez2@hp.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/hp-wmi.c