]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/display: Added missing null checks
authorSohaib Nadeem <sohaib.nadeem@amd.com>
Tue, 12 Mar 2024 21:32:28 +0000 (17:32 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 27 Mar 2024 05:36:44 +0000 (01:36 -0400)
[why&how]
Add the missing null check before dereference for dc_stream_status*

Fixes: 2d5bb791e24f ("drm/amd/display: Implement update_planes_and_stream_v3 sequence")
Reviewed-by: Josip Pavic <josip.pavic@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Sohaib Nadeem <sohaib.nadeem@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c

index 7222917e48bb63ef6af97a22a26605f780861bbe..9030251388db5b1de209982981a4897510c1bfb1 100644 (file)
@@ -4291,6 +4291,9 @@ static int initialize_empty_surface_updates(
        struct dc_stream_status *status = dc_stream_get_status(stream);
        int i;
 
+       if (!status)
+               return 0;
+
        for (i = 0; i < status->plane_count; i++)
                srf_updates[i].surface = status->plane_states[i];