summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/hp
diff options
context:
space:
mode:
authorJorge Lopez <jorge.lopez2@hp.com>2023-07-31 23:31:40 +0300
committerHans de Goede <hdegoede@redhat.com>2023-08-07 14:35:30 +0300
commitefd4211e54d1fe9c788a0506849616b41edbe7d1 (patch)
tree3636043973984e26c24bf68878314d69c646da95 /drivers/platform/x86/hp
parent42efc9e65dfbfc1aab82e20620837d28e92f3a8f (diff)
downloadlinux-efd4211e54d1fe9c788a0506849616b41edbe7d1.tar.xz
platform/x86: hp-bioscfg: Change how password encoding size is evaluated
Update steps how password encoding size is evaluated Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com> Link: https://lore.kernel.org/r/20230731203141.30044-8-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/passwdobj-attributes.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
index afb5190afc03..03d0188804ba 100644
--- a/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
+++ b/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
@@ -335,9 +335,12 @@ static int hp_populate_password_elements_from_package(union acpi_object *passwor
password_data->max_password_length = int_value;
break;
case PSWD_SIZE:
- password_data->encodings_size = int_value;
- if (int_value > MAX_ENCODINGS_SIZE)
+
+ if (int_value > MAX_ENCODINGS_SIZE) {
pr_warn("Password Encoding size value exceeded the maximum number of elements supported or data may be malformed\n");
+ int_value = MAX_ENCODINGS_SIZE;
+ }
+ password_data->encodings_size = int_value;
/* This step is needed to keep the expected
* element list pointing to the right obj[elem].type