]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: Guard against NULL pointer deref when get_i2c_info fails
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Fri, 18 Dec 2020 17:14:00 +0000 (12:14 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 20 Jan 2021 21:38:19 +0000 (16:38 -0500)
commit365e4b69651ae6aef4ba6c4a49c734e4360d14fa
treec087d109b20f8534ab74304837919d5f46e55d41
parent4502231f8cd331b2ac0259d3cb59140fc69633dd
drm/amd/display: Guard against NULL pointer deref when get_i2c_info fails

[Why]
If the BIOS table is invalid or corrupt then get_i2c_info can fail
and we dereference a NULL pointer.

[How]
Check that ddc_pin is not NULL before using it and log an error if it
is because this is unexpected.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Eric Yang <eric.yang2@amd.com>
Acked-by: Anson Jacob <anson.jacob@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link.c