mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
drm/amd/display: Guard against NULL pointer deref when get_i2c_info fails
[ Upstream commit 44a09e3d95 ]
[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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3418abd7c6
commit
a986f93454
@@ -1454,6 +1454,11 @@ static bool dc_link_construct(struct dc_link *link,
|
||||
goto ddc_create_fail;
|
||||
}
|
||||
|
||||
if (!link->ddc->ddc_pin) {
|
||||
DC_ERROR("Failed to get I2C info for connector!\n");
|
||||
goto ddc_create_fail;
|
||||
}
|
||||
|
||||
link->ddc_hw_inst =
|
||||
dal_ddc_get_line(dal_ddc_service_get_ddc_pin(link->ddc));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user