diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2828-drm-amd-display-Fix-couple-more-inconsistent-NULL-ch.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2828-drm-amd-display-Fix-couple-more-inconsistent-NULL-ch.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2828-drm-amd-display-Fix-couple-more-inconsistent-NULL-ch.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2828-drm-amd-display-Fix-couple-more-inconsistent-NULL-ch.patch new file mode 100644 index 00000000..a695c64d --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2828-drm-amd-display-Fix-couple-more-inconsistent-NULL-ch.patch @@ -0,0 +1,59 @@ +From 2bce990a51d449046ab03a81ad40b1610c27e568 Mon Sep 17 00:00:00 2001 +From: Harry Wentland <harry.wentland@amd.com> +Date: Fri, 10 Nov 2017 20:35:27 -0500 +Subject: [PATCH 2828/4131] drm/amd/display: Fix couple more inconsistent NULL + checks in dc_resource + +Found by smatch: +drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:1001 +acquire_free_pipe_for_stream() error: we previously assumed 'head_pipe' +could be null (see line 998) +drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:1808 +dc_validate_global_state() error: we previously assumed 'new_ctx' could +be null (see line 1778) + +Signed-off-by: Harry Wentland <harry.wentland@amd.com> +Reviewed-by: Tony Cheng <Tony.Cheng@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 | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +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 86d3712..9c5e879 100644 +--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c ++++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +@@ -986,8 +986,10 @@ static struct pipe_ctx *acquire_free_pipe_for_stream( + + head_pipe = resource_get_head_pipe_for_stream(res_ctx, stream); + +- if (!head_pipe) ++ if (!head_pipe) { + ASSERT(0); ++ return NULL; ++ } + + if (!head_pipe->plane_state) + return head_pipe; +@@ -1765,13 +1767,16 @@ enum dc_status dc_validate_global_state( + enum dc_status result = DC_ERROR_UNEXPECTED; + int i, j; + ++ if (!new_ctx) ++ return DC_ERROR_UNEXPECTED; ++ + if (dc->res_pool->funcs->validate_global) { + result = dc->res_pool->funcs->validate_global(dc, new_ctx); + if (result != DC_OK) + return result; + } + +- for (i = 0; new_ctx && i < new_ctx->stream_count; i++) { ++ for (i = 0; i < new_ctx->stream_count; i++) { + struct dc_stream_state *stream = new_ctx->streams[i]; + + for (j = 0; j < dc->res_pool->pipe_count; j++) { +-- +2.7.4 + |