From 3c25e920f011d785725985733ca2625defbf680f Mon Sep 17 00:00:00 2001 From: Anthony Koo Date: Tue, 20 Dec 2016 18:48:11 -0500 Subject: [PATCH] drm/amd/display: Reset gamma to NULL after release Signed-off-by: Anthony Koo Reviewed-by: Aric Cyr Acked-by: Harry Wentland Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/display/modules/color/color.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/modules/color/color.c b/drivers/gpu/drm/amd/display/modules/color/color.c index 938867282d04..6d1b20f6bf98 100644 --- 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_color *mod_color, 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++) { -- 2.30.2