mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
drm/amd/display: Fix potential null-deref in dm_resume
[ Upstream commit 7a7175a2cd ]
[Why]
Fixing smatch error:
dm_resume() error: we previously assumed 'aconnector->dc_link' could be null
[How]
Check if dc_link null at the beginning of the loop,
so further checks can be dropped.
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Wayne Lin <Wayne.Lin@amd.com>
Acked-by: Jasdeep Dhillon <jdhillon@amd.com>
Signed-off-by: Roman Li <roman.li@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
6d5273f0f9
commit
00b655fa96
@@ -2747,12 +2747,14 @@ static int dm_resume(void *handle)
|
|||||||
drm_for_each_connector_iter(connector, &iter) {
|
drm_for_each_connector_iter(connector, &iter) {
|
||||||
aconnector = to_amdgpu_dm_connector(connector);
|
aconnector = to_amdgpu_dm_connector(connector);
|
||||||
|
|
||||||
|
if (!aconnector->dc_link)
|
||||||
|
continue;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* this is the case when traversing through already created
|
* this is the case when traversing through already created
|
||||||
* MST connectors, should be skipped
|
* MST connectors, should be skipped
|
||||||
*/
|
*/
|
||||||
if (aconnector->dc_link &&
|
if (aconnector->dc_link->type == dc_connection_mst_branch)
|
||||||
aconnector->dc_link->type == dc_connection_mst_branch)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
mutex_lock(&aconnector->hpd_lock);
|
mutex_lock(&aconnector->hpd_lock);
|
||||||
|
|||||||
Reference in New Issue
Block a user