aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0551-drm-amd-dal-Don-t-access-const-sink.patch
blob: aa39901edb31df5b14a1898275f0d7fb118d3636 (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
From 00cefb514cdb0602a9b7279fc564e2df97c60183 Mon Sep 17 00:00:00 2001
From: Harry Wentland <harry.wentland@amd.com>
Date: Tue, 1 Dec 2015 11:11:01 -0500
Subject: [PATCH 0551/1110] drm/amd/dal: Don't access const sink

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/dal/dc/core/dc.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c
index fded924..01e961a 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c
@@ -849,11 +849,10 @@ void dc_link_remove_sink(struct dc_link *link, const struct dc_sink *sink)
 			link->sink[i] = NULL;
 
 			/* shrink array to remove empty place */
-			dc_service_memmove(
-				&link->sink[i],
-				&link->sink[i + 1],
-				(link->sink_count - i - 1) *
-				sizeof(link->sink[i]));
+			while (i < link->sink_count - 1) {
+				link->sink[i] = link->sink[i+1];
+				i++;
+			}
 
 			link->sink_count--;
 			return;
-- 
2.7.4