Unlock mutex on unsuccessful mmap
authorThomas White <taw@bitwiz.org.uk>
Sun, 16 Aug 2009 17:01:52 +0000 (18:01 +0100)
committerThomas White <taw@bitwiz.org.uk>
Sun, 16 Aug 2009 17:01:52 +0000 (18:01 +0100)
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
drivers/mfd/glamo/glamo-buffer.c

index 815495e..abf8675 100644 (file)
@@ -230,8 +230,10 @@ int glamo_ioctl_gem_mmap(struct drm_device *dev, void *data,
        gobj = obj->driver_private;
        if (!gobj->mmap_offset) {
                ret = glamo_gem_create_mmap_offset(obj);
-               if (ret)
+               if (ret) {
+                       mutex_unlock(&dev->struct_mutex);
                        return ret;
+               }
        }
 
        args->offset = gobj->mmap_offset;