From: Yongqiang Sun <yongqiang.sun@amd.com>
Date: Wed, 11 Jan 2017 15:52:06 -0500
Subject: drm/amd/display: Null check clock source.
Git-commit: 457b74cb3773a1950e49c2d4826d1b295c59bdf1
Patch-mainline: v4.15-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166
Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
@@ -74,7 +74,8 @@ void dp_enable_link_phy(
if (pipes[i].stream != NULL &&
pipes[i].stream->sink != NULL &&
pipes[i].stream->sink->link == link) {
- if (pipes[i].clock_source->id != CLOCK_SOURCE_ID_DP_DTO) {
+ if (pipes[i].clock_source != NULL &&
+ pipes[i].clock_source->id != CLOCK_SOURCE_ID_DP_DTO) {
pipes[i].clock_source = dp_cs;
pipes[i].pix_clk_params.requested_pix_clk =
pipes[i].stream->public.timing.pix_clk_khz;