Skip to content

Commit

Permalink
drm/i915: Unlock mutex on i915_gem_fault() error path
Browse files Browse the repository at this point in the history
If we failed to allocate a new fence register we would return
VM_FAULT_SIGBUS without relinquishing the lock.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
  • Loading branch information
Chris Wilson authored and Dave Airlie committed Feb 8, 2009
1 parent 122ee2a commit 7d8d58b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,10 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
if (obj_priv->fence_reg == I915_FENCE_REG_NONE &&
obj_priv->tiling_mode != I915_TILING_NONE) {
ret = i915_gem_object_get_fence_reg(obj, write);
if (ret != 0)
if (ret) {
mutex_unlock(&dev->struct_mutex);
return VM_FAULT_SIGBUS;
}
}

pfn = ((dev->agp->base + obj_priv->gtt_offset) >> PAGE_SHIFT) +
Expand Down

0 comments on commit 7d8d58b

Please sign in to comment.