The tbo pointer will still have value even the amdgpu bo is freed. It doesn't make sense that it still points a freed memory. It could be refered mistakenly, so set it as null.
Signed-off-by: Huang Rui <ray.hu...@amd.com> Cc: Christian K??nig <christian.koe...@amd.com> Cc: Tom StDenis <tom.stde...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index de990bd..ae84c08 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -108,6 +108,7 @@ static void amdgpu_bo_destroy(struct ttm_buffer_object *tbo) } kfree(bo->metadata); kfree(bo); + tbo = NULL; } /** -- 2.7.4
_______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx