aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
diff options
context:
space:
mode:
authorHawking Zhang <[email protected]>2019-08-31 06:20:38 +0000
committerAlex Deucher <[email protected]>2019-09-13 22:36:22 +0000
commit8bf2485aec63b9a9cc81ad795e1bb7fda19bf33c (patch)
tree14366b8e2ab896d9f827d210f322afd22b11de03 /drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
parentdrm/amdgpu: check mmhub_funcs pointer before refering to it (diff)
downloadkernel-8bf2485aec63b9a9cc81ad795e1bb7fda19bf33c.tar.gz
kernel-8bf2485aec63b9a9cc81ad795e1bb7fda19bf33c.zip
drm/amdgpu: fix memory leak when ras is not supported on specific ip block
free ras_if if ras is not supported Signed-off-by: Hawking Zhang <[email protected]> Reviewed-by: Tao Zhou <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
index af15f4b8e3ad..ab6559a2d5e8 100644
--- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
@@ -639,7 +639,7 @@ static int mmhub_v1_0_ras_late_init(struct amdgpu_device *adev)
mmhub_ih_info.head = mmhub_fs_info.head = *adev->gmc.mmhub_ras_if;
r = amdgpu_ras_late_init(adev, adev->gmc.mmhub_ras_if,
&mmhub_fs_info, &mmhub_ih_info);
- if (r)
+ if (r || !amdgpu_ras_is_supported(adev, adev->gmc.mmhub_ras_if->block))
kfree(adev->gmc.mmhub_ras_if);
return r;
}