diff options
author | Jorge Lopez <jorge.lopez2@hp.com> | 2023-07-31 15:31:39 -0500 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2023-08-07 13:35:28 +0200 |
commit | 42efc9e65dfbfc1aab82e20620837d28e92f3a8f (patch) | |
tree | 0f894eac71fbd010d65bc4a52a79bf7cbb334c4b /drivers/platform/x86/hp | |
parent | 24652a8c0ef04a497e94ca61f686dba529e77e19 (diff) | |
download | linux-stable-42efc9e65dfbfc1aab82e20620837d28e92f3a8f.tar.gz linux-stable-42efc9e65dfbfc1aab82e20620837d28e92f3a8f.tar.bz2 linux-stable-42efc9e65dfbfc1aab82e20620837d28e92f3a8f.zip |
platform/x86: hp-bioscfg: Change how enum possible values size is evaluated
Updates steps how enum possible values size is evaluated
Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com>
Link: https://lore.kernel.org/r/20230731203141.30044-7-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/enum-attributes.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c index 89bb039a8a3c..a2402d31c146 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c @@ -240,9 +240,11 @@ static int hp_populate_enumeration_elements_from_package(union acpi_object *enum str_value, sizeof(enum_data->current_value)); break; case ENUM_SIZE: - enum_data->possible_values_size = int_value; - if (int_value > MAX_VALUES_SIZE) + if (int_value > MAX_VALUES_SIZE) { pr_warn("Possible number values size value exceeded the maximum number of elements supported or data may be malformed\n"); + int_value = MAX_VALUES_SIZE; + } + enum_data->possible_values_size = int_value; /* * This step is needed to keep the expected |