Skip to content

Commit

Permalink
platform/x86: hp-bioscfg: Change how password encoding size is evaluated
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jorge Lopez authored and Hans de Goede committed Aug 7, 2023
1 parent 42efc9e commit efd4211
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit efd4211

Please sign in to comment.