Commit 5838f74c authored by Cong Liu's avatar Cong Liu Committed by Alex Deucher

drm/amdgpu: fix a memory leak in amdgpu_ras_feature_enable

This patch fixes a memory leak in the amdgpu_ras_feature_enable() function.
The leak occurs when the function sends a command to the firmware to enable
or disable a RAS feature for a GFX block. If the command fails, the kfree()
function is not called to free the info memory.

Fixes: 9f051d6f ("drm/amdgpu: Free ras cmd input buffer properly")
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarCong Liu <liucong2@kylinos.cn>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 24f60ddc
...@@ -802,6 +802,7 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev, ...@@ -802,6 +802,7 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev,
enable ? "enable":"disable", enable ? "enable":"disable",
get_ras_block_str(head), get_ras_block_str(head),
amdgpu_ras_is_poison_mode_supported(adev), ret); amdgpu_ras_is_poison_mode_supported(adev), ret);
kfree(info);
return ret; return ret;
} }
......
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