Commit 16e3247d authored by Gerd Hoffmann's avatar Gerd Hoffmann

drm_vblank_get: don't WARN_ON in case vblanks are not initialized

Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 06b718c0
...@@ -1056,6 +1056,9 @@ int drm_vblank_get(struct drm_device *dev, int crtc) ...@@ -1056,6 +1056,9 @@ int drm_vblank_get(struct drm_device *dev, int crtc)
unsigned long irqflags; unsigned long irqflags;
int ret = 0; int ret = 0;
if (!dev->num_crtcs)
return -EINVAL;
if (WARN_ON(crtc >= dev->num_crtcs)) if (WARN_ON(crtc >= dev->num_crtcs))
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment