FROMLIST: firmware: google: increment VPD key_len properly

Commit 4b708b7b1a2c ("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: 4b708b7b1a2c ("firmware: google: check if size is valid when decoding VPD data")
Cc: <stable@vger.kernel.org>
Cc: Hung-Te Lin <hungte@chromium.org>
Cc: Guenter Roeck <groeck@chromium.org>
Cc: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Brian Norris <briannorris@chromium.org>
(am from https://lore.kernel.org/patchwork/patch/1132664/)
(also found at https://lkml.kernel.org/r/20190930214522.240680-1-briannorris@chromium.org)

BUG=chromium:967209
TEST=check `find /sys/firmware/vpd`

Change-Id: I15f6932fcab8094ef5cca87a4c5f7bddc277e006
Reviewed-on: https://chromium-review.googlesource.com/1832653
Tested-by: Brian Norris <briannorris@chromium.org>
Commit-Ready: Brian Norris <briannorris@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
1 file changed