Skip to content

Commit a71718d

Browse files
airliedgregkh
authored andcommitted
drm/amdgpu: set metadata pointer to NULL after freeing.
commit 0092d3edcb23fcdb8cbe4159ba94a534290ff982 upstream. 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. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3d2ef4c commit a71718d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata,
540540
if (!metadata_size) {
541541
if (bo->metadata_size) {
542542
kfree(bo->metadata);
543+
bo->metadata = NULL;
543544
bo->metadata_size = 0;
544545
}
545546
return 0;

0 commit comments

Comments
 (0)