[PATCH] drm/radeon: Don't dereference possibly-NULL pointer.

Alex Deucher alexdeucher at gmail.com
Fri Mar 30 06:18:38 PDT 2012


2012/3/29 Michel Dänzer <michel at daenzer.net>:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>
> Third time's the charm, I hope...
>
>  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 ad9d450..028fcf3 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;
> --
> 1.7.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list