]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm_vblank_get: don't WARN_ON in case vblanks are not initialized
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 30 Mar 2015 10:50:50 +0000 (12:50 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 2 Jun 2015 08:17:21 +0000 (10:17 +0200)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/drm_irq.c

index 1967e7fc98051413cc81d83b02512464d52e183b..dd3fd125995016a4b593e5845ea12eb95f977ea4 100644 (file)
@@ -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;