drm/nouveau: off by one in nouveau_drm_vblank_enable()

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>
This commit is contained in:
Dan Carpenter 2013-09-27 23:17:14 +03:00 committed by Ben Skeggs
parent 1934a2add9
commit ca3562226a

View 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;