diff options
author | Jorge Lopez <jorge.lopez2@hp.com> | 2023-07-31 23:31:38 +0300 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2023-08-07 14:35:23 +0300 |
commit | 24652a8c0ef04a497e94ca61f686dba529e77e19 (patch) | |
tree | 5e4f3a41e6c0f1811a234d1e935b0097fc03bc1f /drivers/platform/x86/hp | |
parent | 08f1f212576c882e6584573f735aee28faaf7c78 (diff) | |
download | linux-24652a8c0ef04a497e94ca61f686dba529e77e19.tar.xz |
platform/x86: hp-bioscfg: Change how order list size is evaluated
Update steps how order list size is evaluated
Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com>
Link: https://lore.kernel.org/r/20230731203141.30044-6-jorge.lopez2@hp.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86/hp')
-rw-r--r-- | drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c index 71f588cbdf88..3b073910b430 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/order-list-attributes.c @@ -243,9 +243,12 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord break; case ORD_LIST_SIZE: + if (int_value > MAX_ELEMENTS_SIZE) { + pr_warn("Order List size value exceeded the maximum number of elements supported or data may be malformed\n"); + int_value = MAX_ELEMENTS_SIZE; + } ordered_list_data->elements_size = int_value; - if (int_value > MAX_ELEMENTS_SIZE) - pr_warn("Ordered List size value exceeded the maximum number of elements supported or data may be malformed\n"); + /* * This step is needed to keep the expected * element list pointing to the right obj[elem].type |