|
@@ -326,24 +326,23 @@ static loff_t ashmem_llseek(struct file *file, loff_t offset, int origin)
|
|
|
mutex_lock(&ashmem_mutex);
|
|
|
|
|
|
if (asma->size == 0) {
|
|
|
- ret = -EINVAL;
|
|
|
- goto out;
|
|
|
+ mutex_unlock(&ashmem_mutex);
|
|
|
+ return -EINVAL;
|
|
|
}
|
|
|
|
|
|
if (!asma->file) {
|
|
|
- ret = -EBADF;
|
|
|
- goto out;
|
|
|
+ mutex_unlock(&ashmem_mutex);
|
|
|
+ return -EBADF;
|
|
|
}
|
|
|
|
|
|
+ mutex_unlock(&ashmem_mutex);
|
|
|
+
|
|
|
ret = vfs_llseek(asma->file, offset, origin);
|
|
|
if (ret < 0)
|
|
|
- goto out;
|
|
|
+ return ret;
|
|
|
|
|
|
/** Copy f_pos from backing file, since f_ops->llseek() sets it */
|
|
|
file->f_pos = asma->file->f_pos;
|
|
|
-
|
|
|
-out:
|
|
|
- mutex_unlock(&ashmem_mutex);
|
|
|
return ret;
|
|
|
}
|
|
|
|