From: Gerd Hoffmann Date: Mon, 30 Mar 2015 10:50:50 +0000 (+0200) Subject: drm_vblank_get: don't WARN_ON in case vblanks are not initialized X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=16e3247da7f71f8c31f4330f739f6192a00c8b51;p=deliverable%2Flinux.git drm_vblank_get: don't WARN_ON in case vblanks are not initialized Signed-off-by: Gerd Hoffmann Reviewed-by: Alex Deucher --- 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;