Commit a71718de authored by Dave Airlie's avatar Dave Airlie Committed by Greg Kroah-Hartman

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

commit 0092d3ed 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: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3d2ef4c1
...@@ -540,6 +540,7 @@ int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata, ...@@ -540,6 +540,7 @@ int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata,
if (!metadata_size) { if (!metadata_size) {
if (bo->metadata_size) { if (bo->metadata_size) {
kfree(bo->metadata); kfree(bo->metadata);
bo->metadata = NULL;
bo->metadata_size = 0; bo->metadata_size = 0;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment