[PATCH 079/103] drm/amd/display: Handle case when stream not found in set_dpms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Eric Yang <Eric.Yang2@xxxxxxx>

When validate with context fail to add stream to the context, we have
a case where set_dpms won't be able to find the stream that need to
be disabled.

Signed-off-by: Eric Yang <Eric.Yang2 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.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 4cdb855ef855..fe66c6a21bc3 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -363,7 +363,7 @@ void set_dpms(
 	struct dc_stream_state *stream,
 	bool dpms_off)
 {
-	struct pipe_ctx *pipe_ctx;
+	struct pipe_ctx *pipe_ctx = NULL;
 	int i;
 
 	for (i = 0; i < MAX_PIPES; i++) {
@@ -373,6 +373,11 @@ void set_dpms(
 		}
 	}
 
+	if (!pipe_ctx) {
+		ASSERT(0);
+		return;
+	}
+
 	if (stream->dpms_off != dpms_off) {
 		stream->dpms_off = dpms_off;
 		if (dpms_off)
-- 
2.14.1



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux