summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorFelix Kuehling <Felix.Kuehling@amd.com>2019-10-03 17:54:57 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-10-07 15:09:33 -0500
commit1995b3a35fecbf8a8078a5c3ff4b4a88eddaa5fe (patch)
tree0bad14ae90dd05969dbbbfcb87eb0125882f5132 /drivers/gpu
parent317a8d9eb612a39daf182986463c067201dc1d29 (diff)
drm/amdgpu: Fix error handling in amdgpu_ras_recovery_init
Don't set a struct pointer to NULL before freeing its members. It's hard to see what's happening due to a local pointer-to-pointer data aliasing con->eh_data. Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Tested-by: Philip Cox <Philip.Cox@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 486568ded6d6..0e2ee5869b5f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -1542,10 +1542,10 @@ int amdgpu_ras_recovery_init(struct amdgpu_device *adev)
release:
amdgpu_ras_release_bad_pages(adev);
free:
- con->eh_data = NULL;
kfree((*data)->bps);
kfree((*data)->bps_bo);
kfree(*data);
+ con->eh_data = NULL;
out:
DRM_WARN("Failed to initialize ras recovery!\n");