OSDN Git Service

drm/amd/display: Fix potential null-deref in dm_resume
authorRoman Li <roman.li@amd.com>
Thu, 1 Dec 2022 14:06:42 +0000 (09:06 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Dec 2022 17:18:18 +0000 (12:18 -0500)
commit7a7175a2cd84b7874bebbf8e59f134557a34161b
tree7cb2cf492b3cfe63c6586dbda3cb216aaa8bbcad
parent639f6ad6df7f47db48b59956b469a6917a136afb
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: 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>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c