From: Shiwu Zhang Date: Wed, 26 May 2021 03:42:14 +0000 (+0800) Subject: drm/amdgpu: free the metadata buffer for sg type BOs as well X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3c609c8b1f2f481b04cca7ddc890a075cec4a6c3;p=linux.git drm/amdgpu: free the metadata buffer for sg type BOs as well Since both sg and device type BOs have metadata buffer, free the buffer in both cases when to destroy BOs Signed-off-by: Shiwu Zhang Acked-by: Nirmoy Das Reviewed-by: Christian König Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 9fcb3bc59558c..b382e9453a665 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -71,7 +71,7 @@ static void amdgpu_bo_destroy(struct ttm_buffer_object *tbo) } amdgpu_bo_unref(&bo->parent); - if (bo->tbo.type == ttm_bo_type_device) { + if (bo->tbo.type != ttm_bo_type_kernel) { ubo = to_amdgpu_bo_user(bo); kfree(ubo->metadata); }