diff options
author | 2023-09-14 17:45:33 +0800 | |
---|---|---|
committer | 2023-09-20 17:27:04 -0400 | |
commit | f387bb578d49c5bf24204810cb2721f151d3eee2 (patch) | |
tree | 640e78c5d87c28cc8d171c664b8b85aef47cfad9 /drivers/gpu/drm/amd/amdgpu | |
parent | Revert "drm/amdgpu: Report vbios version instead of PN" (diff) | |
download | linux-f387bb578d49c5bf24204810cb2721f151d3eee2.tar.gz linux-f387bb578d49c5bf24204810cb2721f151d3eee2.tar.bz2 linux-f387bb578d49c5bf24204810cb2721f151d3eee2.zip |
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: 9f051d6ff13f ("drm/amdgpu: Free ras cmd input buffer properly")
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Cong Liu <liucong2@kylinos.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index 937c54fc7174..163445baa4fc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c @@ -801,6 +801,7 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev, enable ? "enable":"disable", get_ras_block_str(head), amdgpu_ras_is_poison_mode_supported(adev), ret); + kfree(info); return ret; } |