From: Dmytro Laktyushkin Date: Thu, 29 Mar 2018 20:39:10 +0000 (-0400) Subject: drm/amd/display: fix segfault on insufficient TG during validation X-Git-Tag: for-linus-20180616~70^2~12^2~162 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=c5b38aec266deade4067ddc606634ace68d2da8c;p=linux-block.git drm/amd/display: fix segfault on insufficient TG during validation Signed-off-by: Dmytro Laktyushkin Reviewed-by: Dmytro Laktyushkin Acked-by: Harry Wentland Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 8d7bc1fa9ffe..d7a92eca8a27 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -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];