Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: set metadata pointer to NULL after freeing.

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.

Cc: stable@vger.kernel.org
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>

authored by

Dave Airlie and committed by
Alex Deucher
0092d3ed ea996978

+1
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
··· 541 541 if (!metadata_size) { 542 542 if (bo->metadata_size) { 543 543 kfree(bo->metadata); 544 + bo->metadata = NULL; 544 545 bo->metadata_size = 0; 545 546 } 546 547 return 0;