]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amd/display: initialize dc_transfer_func->ctx
authorDavid Francis <David.Francis@amd.com>
Fri, 21 Sep 2018 18:36:17 +0000 (14:36 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 5 Nov 2018 19:20:44 +0000 (14:20 -0500)
[Why]
dc_transfer_func structs were being passed around with a null
pointer, waiting for unsuspecting programmers to dereference it.

[How]
Initialize it

Signed-off-by: David Francis <David.Francis@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_stream.c
drivers/gpu/drm/amd/display/dc/core/dc_surface.c

index 2ac848a106bafc2a4588bcca1b02c23d409757a9..e113439aaa86f5597231f11644064e60279cda20 100644 (file)
@@ -106,6 +106,7 @@ static void construct(struct dc_stream_state *stream,
 
        stream->out_transfer_func = dc_create_transfer_func();
        stream->out_transfer_func->type = TF_TYPE_BYPASS;
+       stream->out_transfer_func->ctx = stream->ctx;
 }
 
 static void destruct(struct dc_stream_state *stream)
index 8fb3aefd195ca3e384babcac8e002106f5cb9e1a..c60c9b4c307531e118ecd4f986985dfa4388ad00 100644 (file)
@@ -44,6 +44,7 @@ static void construct(struct dc_context *ctx, struct dc_plane_state *plane_state
 
        plane_state->in_transfer_func = dc_create_transfer_func();
        plane_state->in_transfer_func->type = TF_TYPE_BYPASS;
+       plane_state->in_transfer_func->ctx = ctx;
 }
 
 static void destruct(struct dc_plane_state *plane_state)