]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:33:02 +0000 (13:33 +0100)
commit21a34c2f396a25c9f97120e40923c496967b1f93
treea05d6b356fa7a8cf1d9923087e87580a83d69616
parent78635a737e752f298eb2c8722da53bf80334be8b
drm/amd/display: fix array index out of bound error in bios parser

[ Upstream commit fa8f7fad111d6e4938aa1ad2134cca174b3fd6c1 ]

[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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c