[patch] drm: checking the wrong variable in savage_do_init_bci()

Ian Romanick idr at freedesktop.org
Thu May 17 10:05:43 PDT 2012


On 05/17/2012 12:09 AM, Dan Carpenter wrote:
> drm_core_ioremap() initializes ->handle.  We already know
> "dev->agp_buffer_map" is a valid pointer.
>
> Signed-off-by: Dan Carpenter<dan.carpenter at oracle.com>

I'm surprised that has never been hit.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

>
> diff --git a/drivers/gpu/drm/savage/savage_bci.c b/drivers/gpu/drm/savage/savage_bci.c
> index cb1ee4e..6eb507a 100644
> --- a/drivers/gpu/drm/savage/savage_bci.c
> +++ b/drivers/gpu/drm/savage/savage_bci.c
> @@ -735,7 +735,7 @@ static int savage_do_init_bci(struct drm_device * dev, drm_savage_init_t * init)
>   			return -EINVAL;
>   		}
>   		drm_core_ioremap(dev->agp_buffer_map, dev);
> -		if (!dev->agp_buffer_map) {
> +		if (!dev->agp_buffer_map->handle) {
>   			DRM_ERROR("failed to ioremap DMA buffer region!\n");
>   			savage_do_cleanup_bci(dev);
>   			return -ENOMEM;
> _______________________________________________
> 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