drm/amd/display: Check pipe_ctx before it is used

resource_get_odm_slice_count and resource_get_otg_master_for_stream can
return null, and their returns must be checked before used.

This fixes 4 NULL_RETURNS issues reported by Coverity.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Alex Hung
2024-06-03 14:27:55 -06:00
committed by Alex Deucher
parent 470f3760cf
commit 7cf24de30e
4 changed files with 14 additions and 2 deletions

View File

@@ -1177,6 +1177,9 @@ static void init_pipe_slice_table_from_context(
stream = context->streams[i];
otg_master = resource_get_otg_master_for_stream(
&context->res_ctx, stream);
if (!otg_master)
continue;
count = resource_get_odm_slice_count(otg_master);
update_slice_table_for_stream(table, stream, count);