aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0637-drm-amd-dal-Do-not-dereference-NULL-sink-at-the-end-.patch
blob: 196818ebc95f14e974604dd79375d04068f89b55 (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
From 011186be4edf1b60f71a8a19c0234660e9a84bb9 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 0637/1110] 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.

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;
 }
-- 
2.7.4