OSDN Git Service

drm/amd/display: fix segfault on insufficient TG during validation
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Thu, 29 Mar 2018 20:39:10 +0000 (16:39 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 May 2018 18:43:23 +0000 (13:43 -0500)
Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_resource.c

index 8d7bc1f..d7a92ec 100644 (file)
@@ -1700,7 +1700,7 @@ enum dc_status resource_map_pool_resources(
                pipe_idx = acquire_first_split_pipe(&context->res_ctx, pool, stream);
 #endif
 
-       if (pipe_idx < 0)
+       if (pipe_idx < 0 || context->res_ctx.pipe_ctx[pipe_idx].stream_res.tg == NULL)
                return DC_NO_CONTROLLER_RESOURCE;
 
        pipe_ctx = &context->res_ctx.pipe_ctx[pipe_idx];