drm/amdgpu: set metadata pointer to NULL after freeing.
Subsystems (2)
Dave Airlie
maintainerPATCH 1/1 drm/amdgpu: set metadata pointer to NULL after freeing.
From: Dave Airlie <[email protected]>
Without this there was a double free of the metadata, which ended up freeing the fd table for me here, and taking out the machine more often than not.
I reproduced with X.org + modesetting DDX + latest llvm/mesa, also required using dri3.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -0
@@ -541,6 +541,7 @@ int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata,if (!metadata_size) {if (bo->metadata_size) {kfree (bo->metadata); + bo->metadata =NULL ; bo->metadata_size =0 ; }return 0 ;
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Am 03.05.2016 um 04:44 schrieb Dave Airlie:
Quoted 11 lines
From: Dave Airlie <[email protected]>
Without this there was a double free of the metadata, which ended up freeing the fd table for me here, and taking out the machine more often than not.
I reproduced with X.org + modesetting DDX + latest llvm/mesa, also required using dri3.
Signed-off-by Dave Airlie <[email protected]>
Nice catch, patch is Reviewed-by: Christian König <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata, · line 547
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1
-0@@ -541,6 +541,7 @@ int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata,if (!metadata_size) {if (bo->metadata_size) {kfree (bo->metadata); + bo->metadata =NULL ; bo->metadata_size =0 ; }return 0 ;
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Alex Deucher
AppliedQuoted 8 lines · Christian König
Am 03.05.2016 um 04:44 schrieb Dave Airlie:
Quoted 7 lines
From: Dave Airlie <[email protected]>
Without this there was a double free of the metadata, which ended up freeing the fd table for me here, and taking out the machine more often than not.
Quoted 8 lines
Quoted 5 lines
I reproduced with X.org + modesetting DDX + latest llvm/mesa, also required using dri3.
Signed-off-by Dave Airlie <[email protected]>Nice catch, patch is Reviewed-by: Christian König <[email protected]>
Applied! thanks.
Alex
Quoted 17 lines
Quoted 17 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1
-0@@ -541,6 +541,7 @@ int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata, if (!metadata_size) {if (bo->metadata_size) {kfree (bo->metadata); + bo->metadata =NULL ; bo->metadata_size =0 ;
Quoted 8 lines
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0
-0}return 0;_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel