Blob Blame History Raw
From: Anthony Koo <Anthony.Koo@amd.com>
Date: Tue, 20 Dec 2016 18:48:11 -0500
Subject: drm/amd/display: Reset gamma to NULL after release
Git-commit: 3c25e920f011d785725985733ca2625defbf680f
Patch-mainline: v4.15-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166

Signed-off-by: Anthony Koo <anthony.koo@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
 drivers/gpu/drm/amd/display/modules/color/color.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/amd/display/modules/color/color.c
+++ b/drivers/gpu/drm/amd/display/modules/color/color.c
@@ -1748,8 +1748,10 @@ bool mod_color_remove_sink(struct mod_co
 
 	for (i = 0; i < core_color->num_sinks; i++) {
 		if (core_color->caps[i].sink == sink) {
-			if (core_color->state[i].gamma)
+			if (core_color->state[i].gamma) {
 				dc_gamma_release(core_color->state[i].gamma);
+				core_color->state[i].gamma = NULL;
+			}
 
 			/* To remove this sink, shift everything after down */
 			for (j = i; j < core_color->num_sinks - 1; j++) {