[PATCH 07/14] drm/amd/display: don't crash if stream is NULL when trying to share clocks

Harry Wentland harry.wentland at amd.com
Fri Dec 23 15:57:59 UTC 2016


From: Yongqiang Sun <yongqiang.sun at amd.com>

Change-Id: I490ec0a8edc46c677d93ebcced7e9d2653999481
Signed-off-by: Yongqiang Sun <yongqiang.sun at amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng at amd.com>
Acked-by: Harry Wentland <Harry.Wentland at amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 5 +++++
 1 file changed, 5 insertions(+)

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 343114b2680f..eac597d0c790 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -288,6 +288,11 @@ static bool is_sharable_clk_src(
 	if (pipe_with_clk_src->clock_source == NULL)
 		return false;
 
+	if (pipe_with_clk_src->stream == NULL) {
+		ASSERT(0);
+		return false;
+	}
+
 	if (pipe_with_clk_src->stream->signal == SIGNAL_TYPE_VIRTUAL)
 		return false;
 
-- 
2.9.3



More information about the amd-gfx mailing list