aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amdfalconx86/recipes-kernel/linux/files/0986-drm-amd-dal-Do-not-dereference-NULL-sink-at-the-end-.patch
blob: 87ebb058ef7af40f7195efd8f5515868d668ffa6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From fca74681bf96fe4c7e4cef4bc4de91b4f2bf7405 Mon Sep 17 00:00:00 2001
From: David Rokhvarg <David.Rokhvarg@amd.com>
Date: Thu, 17 Dec 2015 15:02:29 -0500
Subject: [PATCH 0986/1050] drm/amd/dal: Do not dereference NULL sink at the
 end of sink detection.

While printing detection results for Disconnect case a null sink pointer
was dereferenced.

Change-Id: Ifa07ca1c5ddd081cf456ee8bc067b1bdbe3c1c7a
Signed-off-by: David Rokhvarg <David.Rokhvarg@amd.com>
Acked-by: Jordan Lazare <Jordan.Lazare@amd.com>
---
 drivers/gpu/drm/amd/dal/dc/core/dc_link.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_link.c b/drivers/gpu/drm/amd/dal/dc/core/dc_link.c
index add76ca..d4b1085 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc_link.c
@@ -647,11 +647,13 @@ void dc_link_detect(const struct dc_link *dc_link)
 		link_disconnect_all_sinks(link);
 	}
 
-	LINK_INFO("link=%d, dc_sink_in=%p is now %s\n",
-		link->link_index, &sink->public,
-		(signal == SIGNAL_TYPE_NONE ? "Disconnected":"Connected"));
-
-	/* TODO: */
+	if (signal == SIGNAL_TYPE_NONE) {
+		LINK_INFO("link=%d is now Disconnected.\n",
+				link->link_index);
+	} else {
+		LINK_INFO("link=%d is now Connected. Sink ptr=%p Signal=%d\n",
+				link->link_index, &sink->public, signal);
+	}
 
 	return;
 }
-- 
1.9.1