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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:54 +0000 (09:33 +0100)
commit8e365f1bd672cc9320a936f6ae6f8087aa40e9bc
treefce8c030555e7cfef267a9813d2004ec7923d9da
parent223e365ac60aea701f00aefc24adb3cfd67db1d3
drm/amd/display: Fix potential null-deref in dm_resume

[ Upstream commit 7a7175a2cd84b7874bebbf8e59f134557a34161b ]

[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>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c