drm/amd/display: Check stream_status before it is used
authorAlex Hung <alex.hung@amd.com>
Mon, 15 Jul 2024 16:37:28 +0000 (10:37 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Sat, 27 Jul 2024 21:31:59 +0000 (17:31 -0400)
[WHAT & HOW]
dc_state_get_stream_status can return null, and therefore null must be
checked before stream_status is used.

This fixes 1 NULL_RETURNS issue reported by Coverity.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c

index 95d6e29..4c9e420 100644 (file)
@@ -3748,7 +3748,7 @@ static void commit_planes_for_stream_fast(struct dc *dc,
                                surface_count,
                                stream,
                                context);
-       } else {
+       } else if (stream_status) {
                build_dmub_cmd_list(dc,
                                srf_updates,
                                surface_count,