Message ID | 20130927201714.GI6247@mwanda (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Sat, Sep 28, 2013 at 6:17 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote: > 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> > --- > Somehow this wasn't applied when I sent it earlier. Sorry about this slipping through the cracks. It's in my tree now, so it'll make it to Dave at some point. Thanks, Ben. > > 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@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel
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;