OSDN Git Service

drm/amd/display: Free gamma after calculating legacy transfer function
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Fri, 11 Oct 2019 16:26:10 +0000 (12:26 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 25 Oct 2019 20:50:07 +0000 (16:50 -0400)
[Why]
We're leaking memory by not freeing the gamma used to calculate the
transfer function for legacy gamma.

[How]
Release the gamma after we're done with it.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c

index b43bb7f..2233d29 100644 (file)
@@ -210,6 +210,8 @@ static int __set_legacy_tf(struct dc_transfer_func *func,
        res = mod_color_calculate_regamma_params(func, gamma, true, has_rom,
                                                 NULL);
 
+       dc_gamma_release(&gamma);
+
        return res ? 0 : -ENOMEM;
 }