mirror of
https://github.com/torvalds/linux.git
synced 2026-04-19 23:34:00 -04:00
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: Alex Hung <alex.hung@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Acked-by: Tom Chung <chiahsuan.chung@amd.com> Signed-off-by: Hersen Wu <hersenxs.wu@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user