]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Fix a NULL pointer dereference in dcn20_hwseq.c
authorWenjing Liu <wenjing.liu@amd.com>
Tue, 20 Jan 2026 22:40:07 +0000 (22:40 +0000)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 3 Feb 2026 21:40:06 +0000 (16:40 -0500)
[why]
hws->funcs.dccg_init is accessed without checking if it is NULL, which
may lead to a NULL pointer dereference.

[how]
Add a NULL check before calling dccg_init.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c

index 87a1dc27def4a2d5a30a2f6a6226f94a2ade1c49..307e8f8060e6da8ede09d075fa2e4074f5655ebe 100644 (file)
@@ -3140,7 +3140,8 @@ void dcn20_fpga_init_hw(struct dc *dc)
 
        dcn10_hubbub_global_timer_enable(dc->res_pool->hubbub, true, 2);
 
-       hws->funcs.dccg_init(hws);
+       if (hws->funcs.dccg_init)
+               hws->funcs.dccg_init(hws);
 
        if (dc->res_pool->dccg && dc->res_pool->dccg->funcs && dc->res_pool->dccg->funcs->refclk_setup)
                dc->res_pool->dccg->funcs->refclk_setup(dc->res_pool->dccg);