summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-02-04 15:15:10 +0100
committerDave Airlie <airlied@linux.ie>2009-02-08 12:38:27 +0100
commit7d8d58b23fd01e60ed44d8d8c10b2df86e638faa (patch)
tree78c29f02c8da4829430ba1af164b87216e8a281e /drivers/gpu
parentdrm/i915: Quiet the message on get/setparam ioctl with an unknown value. (diff)
downloadlinux-7d8d58b23fd01e60ed44d8d8c10b2df86e638faa.tar.xz
linux-7d8d58b23fd01e60ed44d8d8c10b2df86e638faa.zip
drm/i915: Unlock mutex on i915_gem_fault() error path
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 6a9e3a875083..1441831fa06e 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -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) +