It isn't necessary to hold ashmem_mutex across shmem_file_setup. ashmem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) Signed-off-by: Robert Love --- linux-base/drivers/staging/android/ashmem.c 2013-04-23 13:18:05.803713678 -0400 +++ linux/drivers/staging/android/ashmem.c 2013-04-23 13:20:26.883238110 -0400 @@ -300,12 +300,15 @@ if (!asma->file) { char *name = ASHMEM_NAME_DEF; struct file *vmfile; + loff_t size = asma->size; if (asma->name[ASHMEM_NAME_PREFIX_LEN] != '\0') name = asma->name; /* ... and allocate the backing shmem file */ - vmfile = shmem_file_setup(name, asma->size, vma->vm_flags); + mutex_unlock(&ashmem_mutex); + vmfile = shmem_file_setup(name, size, vma->vm_flags); + mutex_lock(&ashmem_mutex); if (unlikely(IS_ERR(vmfile))) { ret = PTR_ERR(vmfile); goto out;