drm/amd/display: Fix memleak in amdgpu_dm_mode_config_init
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Wed, 26 Aug 2020 13:24:58 +0000 (21:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Sep 2020 17:14:12 +0000 (19:14 +0200)
commit2c97832bae0870363b7d97f967ef4d9ef7a042b2
treee4ee77f41265c0720040b89ae222c9733557297b
parentfe4e0121247843c66e6ccdc52b951679b15263a8
drm/amd/display: Fix memleak in amdgpu_dm_mode_config_init

[ Upstream commit b67a468a4ccef593cd8df6a02ba3d167b77f0c81 ]

When amdgpu_display_modeset_create_props() fails, state and
state->context should be freed to prevent memleak. It's the
same when amdgpu_dm_audio_init() fails.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c