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>
This commit is contained in:
Gerd Hoffmann 2015-03-30 12:50:50 +02:00
parent 06b718c012
commit 16e3247da7
1 changed files with 3 additions and 0 deletions

View 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;