mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-14 09:30:40 +09:00
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>
This commit is contained in:
committed by
Alex Deucher
parent
317a8d9eb6
commit
1995b3a35f
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user