浏览代码

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>
Dave Airlie 9 年之前
父节点
当前提交
0092d3edcb
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

+ 1 - 0
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

@@ -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;