aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2012-03-29 10:47:43 -0400
committerDave Airlie <airlied@redhat.com>2012-04-02 06:09:50 -0400
commite199fd422420d1620cf64fd9bdd4ff8bc255cc76 (patch)
tree305939ba483e3c935a29aea84c624a536e68e353 /drivers/gpu
parentfa9e855025b19e96e493ee00de7d933a9794f742 (diff)
drm/radeon: Don't dereference possibly-NULL pointer.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/radeon_object.c3
1 files changed, 2 insertions, 1 deletions
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,
241 domain_start = bo->rdev->mc.vram_start; 241 domain_start = bo->rdev->mc.vram_start;
242 else 242 else
243 domain_start = bo->rdev->mc.gtt_start; 243 domain_start = bo->rdev->mc.gtt_start;
244 WARN_ON_ONCE((*gpu_addr - domain_start) > max_offset); 244 WARN_ON_ONCE(max_offset <
245 (radeon_bo_gpu_offset(bo) - domain_start));
245 } 246 }
246 247
247 return 0; 248 return 0;