drm/amdgpu: Fix error handling in amdgpu_ras_recovery_init
Subsystems (2)
PATCH 1/1 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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +1 -1
@@ -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" );
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20191003220028.13107-1-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org
Zhang, Hawking
Reviewed-by Hawking ZhangRegards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Kuehling, Felix
Sent: 2019年10月4日 6:01
To: [email protected]; Grodzovsky, Andrey <[email protected]>
Cc: Cox, Philip <[email protected]>
Subject: [PATCH 1/1] 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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +1 -1
@@ -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" );
--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx