drm/amd/display: fix array index out of bound error in bios parser
authorAurabindo Pillai <aurabindo.pillai@amd.com>
Wed, 2 Nov 2022 19:35:53 +0000 (15:35 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Nov 2022 18:35:14 +0000 (13:35 -0500)
commit4fc1ba4aa589ca267468ad23fedef37562227d32
tree813e34c78ea42f65060b7c323186aa02668b13fa
parent6f8816261db9251f2635533572f95ab8e530266c
drm/amd/display: fix array index out of bound error in bios parser

[Why&How]
Firmware headers dictate that gpio_pin array only has a size of 8. The
count returned from vbios however is greater than 8.

Fix this by not using array indexing but incrementing the pointer since
gpio_pin definition in atomfirmware.h is hardcoded to size 8

Reviewed-by: Martin Leung <Martin.Leung@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c