summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_irq.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2015-03-30 12:50:50 +0200
committerGerd Hoffmann <kraxel@redhat.com>2015-06-02 10:17:21 +0200
commit16e3247da7f71f8c31f4330f739f6192a00c8b51 (patch)
treef8348ffbe2d90d24e107d418faf1c04a06eddb58 /drivers/gpu/drm/drm_irq.c
parent06b718c01208d8f5fff9216c95d5b20984804df7 (diff)
drm_vblank_get: don't WARN_ON in case vblanks are not initialized
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/drm_irq.c')
-rw-r--r--drivers/gpu/drm/drm_irq.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 1967e7fc9805..dd3fd1259950 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -1056,6 +1056,9 @@ int drm_vblank_get(struct drm_device *dev, int crtc)
unsigned long irqflags;
int ret = 0;
+ if (!dev->num_crtcs)
+ return -EINVAL;
+
if (WARN_ON(crtc >= dev->num_crtcs))
return -EINVAL;