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

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 <shiwu.zhang@amd.com>
Acked-by: Nirmoy Das <Nirmoy.das@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Shiwu Zhang and committed by
Alex Deucher
3c609c8b eba98523

+1 -1
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
··· 71 71 } 72 72 amdgpu_bo_unref(&bo->parent); 73 73 74 - if (bo->tbo.type == ttm_bo_type_device) { 74 + if (bo->tbo.type != ttm_bo_type_kernel) { 75 75 ubo = to_amdgpu_bo_user(bo); 76 76 kfree(ubo->metadata); 77 77 }