Skip to content

Commit 442f1e7

Browse files
computersforpeacegregkh
authored andcommitted
firmware: google: increment VPD key_len properly
Commit 4b708b7 ("firmware: google: check if size is valid when decoding VPD data") adds length checks, but the new vpd_decode_entry() function botched the logic -- it adds the key length twice, instead of adding the key and value lengths separately. On my local system, this means vpd.c's vpd_section_create_attribs() hits an error case after the first attribute it parses, since it's no longer looking at the correct offset. With this patch, I'm back to seeing all the correct attributes in /sys/firmware/vpd/... Fixes: 4b708b7 ("firmware: google: check if size is valid when decoding VPD data") Cc: <[email protected]> Cc: Hung-Te Lin <[email protected]> Signed-off-by: Brian Norris <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b058b25 commit 442f1e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/firmware/google/vpd_decode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static int vpd_decode_entry(const u32 max_len, const u8 *input_buf,
5252
if (max_len - consumed < *entry_len)
5353
return VPD_FAIL;
5454

55-
consumed += decoded_len;
55+
consumed += *entry_len;
5656
*_consumed = consumed;
5757
return VPD_OK;
5858
}

0 commit comments

Comments
 (0)