Commit 3c609c8b authored by Shiwu Zhang's avatar Shiwu Zhang Committed by Alex Deucher
Browse files

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: default avatarShiwu Zhang <shiwu.zhang@amd.com>
Acked-by: default avatarNirmoy Das <Nirmoy.das@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent eba98523
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
	}