Commit ca356222 authored by Dan Carpenter's avatar Dan Carpenter Committed by Ben Skeggs

drm/nouveau: off by one in nouveau_drm_vblank_enable()

The test here should be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarMaarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 1934a2ad
...@@ -93,7 +93,7 @@ nouveau_drm_vblank_enable(struct drm_device *dev, int head) ...@@ -93,7 +93,7 @@ nouveau_drm_vblank_enable(struct drm_device *dev, int head)
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_disp *pdisp = nouveau_disp(drm->device); 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; return -EIO;
WARN_ON_ONCE(drm->vblank[head].func); WARN_ON_ONCE(drm->vblank[head].func);
drm->vblank[head].func = nouveau_drm_vblank_handler; drm->vblank[head].func = nouveau_drm_vblank_handler;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment