summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pci/drm/drm_irq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_irq.c b/sys/dev/pci/drm/drm_irq.c
index 0c49c987cbd..c67d0912dbf 100644
--- a/sys/dev/pci/drm/drm_irq.c
+++ b/sys/dev/pci/drm/drm_irq.c
@@ -286,7 +286,7 @@ drm_modeset_ctl(struct drm_device *dev, void *data, struct drm_file *file_priv)
return (0);
crtc = modeset->crtc;
- if (crtc >= dev->vblank->vb_num)
+ if (crtc >= dev->vblank->vb_num || crtc < 0)
return (EINVAL);
vbl = &dev->vblank->vb_crtcs[crtc];