From: Michel Dänzer Date: Thu, 29 Mar 2012 14:47:43 +0000 (+0200) Subject: drm/radeon: Don't dereference possibly-NULL pointer. X-Git-Tag: MMI-PSA29.97-13-9~17071^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e199fd422420d1620cf64fd9bdd4ff8bc255cc76;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git drm/radeon: Don't dereference possibly-NULL pointer. Reported-by: Dan Carpenter Signed-off-by: Michel Dänzer Reviewed-by: Alex Deucher Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index 6f70158d34e4..df6a4dbd93f8 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c @@ -241,7 +241,8 @@ int radeon_bo_pin_restricted(struct radeon_bo *bo, u32 domain, u64 max_offset, domain_start = bo->rdev->mc.vram_start; else domain_start = bo->rdev->mc.gtt_start; - WARN_ON_ONCE((*gpu_addr - domain_start) > max_offset); + WARN_ON_ONCE(max_offset < + (radeon_bo_gpu_offset(bo) - domain_start)); } return 0;