1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/gpu/drm/amd/display
Srinivasan Shanmugam a589fa17cc drm/amd/display: Fix possible NULL dereference on device remove/driver unload
As part of a cleanup amdgpu_dm_fini() function, which is typically
called when a device is being shut down or a driver is being unloaded

The below error message suggests that there is a potential null pointer
dereference issue with adev->dm.dc.

In the below, line of code where adev->dm.dc is used without a preceding
null check:

for (i = 0; i < adev->dm.dc->caps.max_links; i++) {

To fix this issue, add a null check for adev->dm.dc before this line.

Reported by smatch:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:1959 amdgpu_dm_fini() error: we previously assumed 'adev->dm.dc' could be null (see line 1943)

Fixes: 006c26a0f1 ("drm/amd/display: Fix crash on device remove/driver unload")
Cc: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Roman Li <roman.li@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2024-02-15 14:18:43 -05:00
..
amdgpu_dm drm/amd/display: Fix possible NULL dereference on device remove/driver unload 2024-02-15 14:18:43 -05:00
dc Revert "drm/amd/display: increased min_dcfclk_mhz and min_fclk_mhz" 2024-02-15 14:18:43 -05:00
dmub drm/amd/display: Replay + IPS + ABM in Full Screen VPB 2024-01-25 16:00:24 -05:00
include drm/amd/display: To adjust dprefclk by down spread percentage 2024-01-09 15:43:53 -05:00
modules drm/amd/display: Replay + IPS + ABM in Full Screen VPB 2024-01-25 16:00:24 -05:00
Kconfig drm/amd/display: Allow building DC with clang on RISC-V 2023-07-21 16:52:25 -04:00
Makefile drm/amd/display: Refactor OPTC into component folder 2023-11-29 16:49:01 -05:00
TODO