Commit 9d6bd606 authored by Wenjing Liu's avatar Wenjing Liu Committed by Alex Deucher
Browse files

drm/amd/display: Fix a NULL pointer dereference in dcn20_hwseq.c



[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: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Signed-off-by: default avatarWayne Lin <wayne.lin@amd.com>
Tested-by: default avatarDan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e121ccca
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3140,6 +3140,7 @@ void dcn20_fpga_init_hw(struct dc *dc)

	dcn10_hubbub_global_timer_enable(dc->res_pool->hubbub, true, 2);

	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)