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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2012/3/29 Michel Dänzer <michel@xxxxxxxxxxx>:
> From: Michel Dänzer <michel.daenzer@xxxxxxx>
>
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Signed-off-by: Michel Dänzer <michel.daenzer@xxxxxxx>

Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>

> ---
>
> 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@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux