提交 7a7175a2 编写于 作者: R Roman Li 提交者: Alex Deucher

drm/amd/display: Fix potential null-deref in dm_resume

[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: Nkernel test robot <lkp@intel.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NWayne Lin <Wayne.Lin@amd.com>
Acked-by: NJasdeep Dhillon <jdhillon@amd.com>
Signed-off-by: NRoman Li <roman.li@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 639f6ad6
...@@ -2739,12 +2739,14 @@ static int dm_resume(void *handle) ...@@ -2739,12 +2739,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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册