Commit 299eb93c authored by Eric Anholt's avatar Eric Anholt Committed by Dave Airlie

drm/i915: Fix use-before-null-check in i915_irq_emit().

This could be triggered by a client asking to emit an irq when the device
wasn't initialized.
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarDave Airlie <airlied@linux.ie>
parent fda714c2
...@@ -383,12 +383,13 @@ int i915_irq_emit(struct drm_device *dev, void *data, ...@@ -383,12 +383,13 @@ int i915_irq_emit(struct drm_device *dev, void *data,
drm_i915_irq_emit_t *emit = data; drm_i915_irq_emit_t *emit = data;
int result; int result;
RING_LOCK_TEST_WITH_RETURN(dev, file_priv);
if (!dev_priv) { if (!dev_priv) {
DRM_ERROR("called with no initialization\n"); DRM_ERROR("called with no initialization\n");
return -EINVAL; return -EINVAL;
} }
RING_LOCK_TEST_WITH_RETURN(dev, file_priv);
mutex_lock(&dev->struct_mutex); mutex_lock(&dev->struct_mutex);
result = i915_emit_irq(dev); result = i915_emit_irq(dev);
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
......
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