drm/nouveau: off by one in nouveau_drm_vblank_enable()
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 drm/nouveau: off by one in nouveau_drm_vblank_enable()
The test here should be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".
---
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.
drivers/gpu/drm/nouveau/nouveau_drm.c +1 -1
@@ -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;
Op 03-04-13 10:05, Dan Carpenter schreef:
Quoted 3 lines
The test here should be ">=
ARRAY_SIZE()" instead of ">ARRAY_SIZE()".Signed-off-by Dan Carpenter <[email protected]>
Quoted 18 lines
---
This was introduced ingit://git.freedesktop.org/git/nouveau/linux-2.6drm-nouveau-fixes-3.9 It hadn't hit linux-next yet yesterday.drivers/gpu/drm/nouveau/nouveau_drm.c +1
-1@@ -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;
Quoted 5 lines · Maarten Lankhorst
Op 03-04-13 10:05, Dan Carpenter schreef:
Quoted 3 lines
The test here should be ">=
ARRAY_SIZE()" instead of ">ARRAY_SIZE()".Signed-off-by Dan Carpenter <[email protected]>
We still need this patch in linux-next.
regards,
dan carpenter
PATCH 1/1 drm/nouveau: off by one in nouveau_drm_vblank_enable()
In reply to Maarten LankhorstThe test here should be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".
---
Somehow this wasn't applied when I sent it earlier.
drivers/gpu/drm/nouveau/nouveau_drm.c +1 -1
@@ -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;
Quoted 6 lines · Dan Carpenter
The test here should be ">=
ARRAY_SIZE()" instead of ">ARRAY_SIZE()".Signed-off-by Dan Carpenter <[email protected]>---
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.
Quoted 18 lines
drivers/gpu/drm/nouveau/nouveau_drm.c +1
-1@@ -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
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel