Re: [patch] drm/nouveau: off by one in nouveau_drm_vblank_enable()

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

 



Op 03-04-13 10:05, Dan Carpenter schreef:
> The test here should be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".
>
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Acked-by: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxx>
> ---
> This was introduced in git://git.freedesktop.org/git/nouveau/linux-2.6 drm-nouveau-fixes-3.9
> It hadn't hit linux-next yet yesterday.
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
> index c95decf..e11f8e4 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_drm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
> @@ -86,7 +86,7 @@ nouveau_drm_vblank_enable(struct drm_device *dev, int head)
>  	struct nouveau_drm *drm = nouveau_drm(dev);
>  	struct nouveau_disp *pdisp = nouveau_disp(drm->device);
>  
> -	if (WARN_ON_ONCE(head > ARRAY_SIZE(drm->vblank)))
> +	if (WARN_ON_ONCE(head >= ARRAY_SIZE(drm->vblank)))
>  		return -EIO;
>  	WARN_ON_ONCE(drm->vblank[head].func);
>  	drm->vblank[head].func = nouveau_drm_vblank_handler;
>

_______________________________________________
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