Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143643
b: refs/heads/master
c: 4ddfc91
h: refs/heads/master
i:
  143641: 1e70743
  143639: 4b9e3bd
v: v3
  • Loading branch information
Arve Hjønnevåg authored and Greg Kroah-Hartman committed Apr 17, 2009
1 parent c92f158 commit e4d45ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 85e0b0cbbfc17e7f7baa9e76f9a937249108fc52
refs/heads/master: 4ddfc911e39a01f95ad9765d3b9e6f43e14eeff4
10 changes: 9 additions & 1 deletion trunk/drivers/staging/android/binder.c
Original file line number Diff line number Diff line change
Expand Up @@ -2694,6 +2694,12 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
}
vma->vm_flags = (vma->vm_flags | VM_DONTCOPY) & ~VM_MAYWRITE;

if (proc->buffer) {
ret = -EBUSY;
failure_string = "already mapped";
goto err_already_mapped;
}

area = get_vm_area(vma->vm_end - vma->vm_start, VM_IOREMAP);
if (area == NULL) {
ret = -ENOMEM;
Expand Down Expand Up @@ -2741,10 +2747,12 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)

err_alloc_small_buf_failed:
kfree(proc->pages);
proc->pages = NULL;
err_alloc_pages_failed:
vfree(proc->buffer);
proc->buffer = NULL;
err_get_vm_area_failed:
mutex_unlock(&binder_lock);
err_already_mapped:
err_bad_arg:
printk(KERN_ERR "binder_mmap: %d %lx-%lx %s failed %d\n", proc->pid, vma->vm_start, vma->vm_end, failure_string, ret);
return ret;
Expand Down

0 comments on commit e4d45ed

Please sign in to comment.