Commit fd6ecc90 authored by Guchun Chen's avatar Guchun Chen Committed by Alex Deucher
Browse files

drm/radeon: avoid potential null pointer access



Leverage the same logic from amdgpu_ttm_tt_unpin_userptr.

Signed-off-by: default avatarGuchun Chen <guchun.chen@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 9973de10
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -415,7 +415,7 @@ static void radeon_ttm_tt_unpin_userptr(struct ttm_device *bdev, struct ttm_tt *
		DMA_BIDIRECTIONAL : DMA_TO_DEVICE;

	/* double check that we don't free the table twice */
	if (!ttm->sg->sgl)
	if (!ttm->sg || !ttm->sg->sgl)
		return;

	/* free the sg table and pages again */