diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3050-drm-amd-display-Remove-unnecessary-NULL-check-in-set.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3050-drm-amd-display-Remove-unnecessary-NULL-check-in-set.patch | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3050-drm-amd-display-Remove-unnecessary-NULL-check-in-set.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3050-drm-amd-display-Remove-unnecessary-NULL-check-in-set.patch new file mode 100644 index 00000000..f3ffa336 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3050-drm-amd-display-Remove-unnecessary-NULL-check-in-set.patch @@ -0,0 +1,56 @@ +From 5af27eaf2f6385cce2874b4a0c5749ad193c40be Mon Sep 17 00:00:00 2001 +From: Harry Wentland <harry.wentland@amd.com> +Date: Fri, 31 May 2019 14:17:43 -0400 +Subject: [PATCH 3050/4256] drm/amd/display: Remove unnecessary NULL check in + set_preferred_link_settings + +[Why] +link_stream is never NULL here as we've dereferenced it a couple lines before +and have done so for a couple months now. + +[How] +- Drop the NULL check. +- Initialize where we know link_stream is non-NULL + +Signed-off-by: Harry Wentland <harry.wentland@amd.com> +Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com> +Acked-by: Leo Li <sunpeng.li@amd.com> +--- + drivers/gpu/drm/amd/display/dc/core/dc_link.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c +index b7c2ac3033f2..815b687de494 100644 +--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c ++++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c +@@ -3021,8 +3021,10 @@ void dc_link_set_preferred_link_settings(struct dc *dc, + for (i = 0; i < MAX_PIPES; i++) { + pipe = &dc->current_state->res_ctx.pipe_ctx[i]; + if (pipe->stream && pipe->stream->link) { +- if (pipe->stream->link == link) ++ if (pipe->stream->link == link) { ++ link_stream = pipe->stream; + break; ++ } + } + } + +@@ -3030,14 +3032,11 @@ void dc_link_set_preferred_link_settings(struct dc *dc, + if (i == MAX_PIPES) + return; + +- link_stream = link->dc->current_state->res_ctx.pipe_ctx[i].stream; +- + /* Cannot retrain link if backend is off */ + if (link_stream->dpms_off) + return; + +- if (link_stream) +- decide_link_settings(link_stream, &store_settings); ++ decide_link_settings(link_stream, &store_settings); + + if ((store_settings.lane_count != LANE_COUNT_UNKNOWN) && + (store_settings.link_rate != LINK_RATE_UNKNOWN)) +-- +2.17.1 + |