Commit 52cbcf98 authored by Hersen Wu's avatar Hersen Wu Committed by Alex Deucher

drm/amd/display: Release state memory if amdgpu_dm_create_color_properties fail

[Why]
Coverity reports RESOURCE_LEAK warning. State memory
is not released if dm_create_color_properties fail.

[How]
Call kfree(state) before return.
Reviewed-by: default avatarAlex Hung <alex.hung@amd.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Acked-by: default avatarTom Chung <chiahsuan.chung@amd.com>
Signed-off-by: default avatarHersen Wu <hersenxs.wu@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent fa71face
......@@ -4229,8 +4229,11 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev)
}
#ifdef AMD_PRIVATE_COLOR
if (amdgpu_dm_create_color_properties(adev))
if (amdgpu_dm_create_color_properties(adev)) {
dc_state_release(state->context);
kfree(state);
return -ENOMEM;
}
#endif
r = amdgpu_dm_audio_init(adev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment