drm/nouveau: off by one in nouveau_drm_vblank_enable()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 27 Sep 2013 20:17:14 +0000 (23:17 +0300)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 8 Nov 2013 05:36:02 +0000 (15:36 +1000)
The test here should be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_drm.c

index 428d818be7757c0c2f8ca655fc194580080863f6..20626b93130c1d62416f5ed8ac616ffa8c8db26b 100644 (file)
@@ -93,7 +93,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;