diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2015-03-30 10:50:50 (GMT) |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-06-02 08:17:21 (GMT) |
commit | 16e3247da7f71f8c31f4330f739f6192a00c8b51 (patch) | |
tree | f8348ffbe2d90d24e107d418faf1c04a06eddb58 | |
parent | 06b718c01208d8f5fff9216c95d5b20984804df7 (diff) | |
download | linux-16e3247da7f71f8c31f4330f739f6192a00c8b51.tar.xz |
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>
-rw-r--r-- | drivers/gpu/drm/drm_irq.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 1967e7f..dd3fd12 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; |