Commit 1cd99a8d authored by Alex Xie's avatar Alex Xie Committed by Alex Deucher
Browse files

drm/amd/amdgpu: validate the shadow BO.



Fixes a rare NULL pointer dereference in amdgpu_ttm_bind.

The issue was found by Nicolai Haehnle.
The patch was tested by Nicolai Haehnle.

Signed-off-by: default avatarAlex Xie <AlexBin.Xie@amd.com>
Reviewed-by: default avatarChunming Zhou <david1.zhou@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
parent f5f857f4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -451,7 +451,7 @@ static int amdgpu_cs_validate(void *param, struct amdgpu_bo *bo)
		return r;

	if (bo->shadow)
		r = amdgpu_cs_bo_validate(p, bo);
		r = amdgpu_cs_bo_validate(p, bo->shadow);

	return r;
}