Skip to content

Commit efd4211

Browse files
Jorge Lopezjwrdegoede
authored andcommitted
platform/x86: hp-bioscfg: Change how password encoding size is evaluated
Update steps how password encoding size is evaluated Signed-off-by: Jorge Lopez <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 42efc9e commit efd4211

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,12 @@ static int hp_populate_password_elements_from_package(union acpi_object *passwor
335335
password_data->max_password_length = int_value;
336336
break;
337337
case PSWD_SIZE:
338-
password_data->encodings_size = int_value;
339-
if (int_value > MAX_ENCODINGS_SIZE)
338+
339+
if (int_value > MAX_ENCODINGS_SIZE) {
340340
pr_warn("Password Encoding size value exceeded the maximum number of elements supported or data may be malformed\n");
341+
int_value = MAX_ENCODINGS_SIZE;
342+
}
343+
password_data->encodings_size = int_value;
341344

342345
/* This step is needed to keep the expected
343346
* element list pointing to the right obj[elem].type

0 commit comments

Comments
 (0)