From: Xiaojie Yuan Date: Tue, 4 Jul 2017 06:21:58 +0000 (+0800) Subject: drm/amd/display: Fix misuse of plane state destroy helper X-Git-Tag: Ubuntu-5.10.0-12.13~8971^2~23^2~387 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=a67297d4c8d0bfac39a0fa166e98dcf54db1d7c2;p=mirror_ubuntu-hirsute-kernel.git drm/amd/display: Fix misuse of plane state destroy helper drm_plane_state is subclassed by dm_plane_state, so atomic driver should use __drm_atomic_helper_plane_destroy_state() to destroy a state. drm_atomic_helper_plane_destroy_state() frees drm_plane_state which is allocated inside dm_plane_state, this is problematic. Fixes: 95ae03a ("drm/amd/display: Create dm_plane_state.") Signed-off-by: Xiaojie Yuan Reviewed-by: Andrey Grodzovsky Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c index 6f08fab1cce7..64cb635b4137 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c @@ -1431,7 +1431,8 @@ void dm_drm_plane_destroy_state(struct drm_plane *plane, dc_surface_release(dc_surface); } - drm_atomic_helper_plane_destroy_state(plane, state); + __drm_atomic_helper_plane_destroy_state(state); + kfree(dm_plane_state); } static const struct drm_plane_funcs dm_plane_funcs = {