drm/amd/display: Added Check For dc->res_pool
authorJarif Aftab <jaraftab@amd.com>
Wed, 24 Nov 2021 18:44:52 +0000 (13:44 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 7 Dec 2021 18:10:22 +0000 (13:10 -0500)
[WHY]
-To ensure dc->res_pool has been initialized

[HOW]
-Check if dc->res_pool is true in
the if statement

Reviewed-by: Martin Leung <Martin.Leung@amd.com>
Acked-by: Pavle Kotarac <Pavle.Kotarac@amd.com>
Signed-off-by: Jarif Aftab <jaraftab@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c

index bd6541f1c8bbd1c48835b7a7fd33dbbc6b9df525..471620a3d7ae33f98cc02627056171abe14e2825 100644 (file)
@@ -809,7 +809,7 @@ void dc_stream_set_static_screen_params(struct dc *dc,
 static void dc_destruct(struct dc *dc)
 {
        // reset link encoder assignment table on destruct
-       if (dc->res_pool->funcs->link_encs_assign)
+       if (dc->res_pool && dc->res_pool->funcs->link_encs_assign)
                link_enc_cfg_init(dc, dc->current_state);
 
        if (dc->current_state) {