]> git.baikalelectronics.ru Git - kernel.git/commit
firmware: google: increment VPD key_len properly
authorBrian Norris <briannorris@chromium.org>
Mon, 30 Sep 2019 21:45:22 +0000 (14:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Oct 2019 06:41:34 +0000 (08:41 +0200)
commit97678d051eab9e021b46786362bb06e7b427407f
tree1639715dda354da74a868977151f6be2c9bc15c5
parent0dc089d69adf280239753446653e525e9e66dac0
firmware: google: increment VPD key_len properly

Commit b7d73c97b09e ("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: b7d73c97b09e ("firmware: google: check if size is valid when decoding VPD data")
Cc: <stable@vger.kernel.org>
Cc: Hung-Te Lin <hungte@chromium.org>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Link: https://lore.kernel.org/r/20190930214522.240680-1-briannorris@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/google/vpd_decode.c