drm/amd/display: Reset gamma to NULL after release
authorAnthony Koo <Anthony.Koo@amd.com>
Tue, 20 Dec 2016 23:48:11 +0000 (18:48 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 21:06:47 +0000 (17:06 -0400)
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>
drivers/gpu/drm/amd/display/modules/color/color.c

index 9388672..6d1b20f 100644 (file)
@@ -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++) {