drm/amd/display: Set stream_count to 0 when dc_resource_state_destruct.
authorPaul Wu <paul.wu@amd.com>
Fri, 16 Apr 2021 05:33:26 +0000 (13:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 10 May 2021 22:06:44 +0000 (18:06 -0400)
[Why]
When hardware need to be reset, driver need to reset stream objects but
dc_resource_state_destruct function omit resetting stream_count. It will
lead page fault if some logic will touch stream object.

[How]
Set stream_count to 0 when dc_resource_state_destruct.

Signed-off-by: Paul Wu <paul.wu@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Wayne Lin <Wayne.Lin@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_resource.c

index 9fb0930..f2bc630 100644 (file)
@@ -2673,6 +2673,7 @@ void dc_resource_state_destruct(struct dc_state *context)
                dc_stream_release(context->streams[i]);
                context->streams[i] = NULL;
        }
+       context->stream_count = 0;
 }
 
 void dc_resource_state_copy_construct(