gpu: ion: minor refactor in ion_mmap
mutex_unlock is being called in the if and the else branch. Just move
it out of the if/else. This will help reduce upcoming merge conflicts
with upstream Ion changes.
Change-Id: Ib426e73f1cb9ed79f37b9c1e0a8885066ae5b4f4
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c
index 9ab2343..9128177 100644
--- a/drivers/gpu/ion/ion.c
+++ b/drivers/gpu/ion/ion.c
@@ -1248,14 +1248,12 @@
mutex_lock(&buffer->lock);
/* now map it to userspace */
ret = buffer->heap->ops->map_user(buffer->heap, buffer, vma);
+ mutex_unlock(&buffer->lock);
if (ret) {
- mutex_unlock(&buffer->lock);
pr_err("%s: failure mapping buffer to userspace\n",
__func__);
} else {
- mutex_unlock(&buffer->lock);
-
vma->vm_ops = &ion_vm_ops;
/*
* move the buffer into the vm_private_data so we can access it