summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/radeon_object.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2012-03-29 18:47:43 +0400
committerDave Airlie <airlied@redhat.com>2012-04-02 14:09:50 +0400
commite199fd422420d1620cf64fd9bdd4ff8bc255cc76 (patch)
tree305939ba483e3c935a29aea84c624a536e68e353 /drivers/gpu/drm/radeon/radeon_object.c
parentfa9e855025b19e96e493ee00de7d933a9794f742 (diff)
downloadlinux-e199fd422420d1620cf64fd9bdd4ff8bc255cc76.tar.xz
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/drm/radeon/radeon_object.c')
-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,
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;