summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
diff options
context:
space:
mode:
authorShiwu Zhang <shiwu.zhang@amd.com>2021-05-26 11:42:14 +0800
committerAlex Deucher <alexander.deucher@amd.com>2021-06-01 22:36:23 -0400
commit3c609c8b1f2f481b04cca7ddc890a075cec4a6c3 (patch)
tree4601b762fe15790ad689a152085f9341ee472b0c /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
parenteba98523724be7ad3539f2c975de1527e0c99dd6 (diff)
downloadlinux-3c609c8b1f2f481b04cca7ddc890a075cec4a6c3.tar.bz2
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>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 9fcb3bc59558..b382e9453a66 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);
}