diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2012-03-29 16:47:43 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-04-02 11:09:50 +0100 |
commit | e199fd422420d1620cf64fd9bdd4ff8bc255cc76 (patch) | |
tree | 305939ba483e3c935a29aea84c624a536e68e353 /drivers/gpu/drm/radeon/radeon_object.c | |
parent | fa9e855025b19e96e493ee00de7d933a9794f742 (diff) | |
download | linux-e199fd422420d1620cf64fd9bdd4ff8bc255cc76.tar.bz2 |
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.c | 3 |
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; |