Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199448
b: refs/heads/master
c: e30c7c3
h: refs/heads/master
v: v3
  • Loading branch information
Takuya Yoshikawa authored and Linus Torvalds committed Jun 1, 2010
1 parent f6b6ea9 commit 43ee096
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 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: 293a7cfeedc2b2380a7c7274902323c3cf5f7575
refs/heads/master: e30c7c3b306312c157d67eedd6a01920518b756c
26 changes: 11 additions & 15 deletions trunk/fs/binfmt_elf_fdpic.c
Original file line number Diff line number Diff line change
Expand Up @@ -990,10 +990,9 @@ static int elf_fdpic_map_file_constdisp_on_uclinux(

/* clear any space allocated but not loaded */
if (phdr->p_filesz < phdr->p_memsz) {
ret = clear_user((void *) (seg->addr + phdr->p_filesz),
phdr->p_memsz - phdr->p_filesz);
if (ret)
return ret;
if (clear_user((void *) (seg->addr + phdr->p_filesz),
phdr->p_memsz - phdr->p_filesz))
return -EFAULT;
}

if (mm) {
Expand Down Expand Up @@ -1027,7 +1026,7 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
struct elf32_fdpic_loadseg *seg;
struct elf32_phdr *phdr;
unsigned long load_addr, delta_vaddr;
int loop, dvset, ret;
int loop, dvset;

load_addr = params->load_addr;
delta_vaddr = 0;
Expand Down Expand Up @@ -1127,9 +1126,8 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
* PT_LOAD */
if (prot & PROT_WRITE && disp > 0) {
kdebug("clear[%d] ad=%lx sz=%lx", loop, maddr, disp);
ret = clear_user((void __user *) maddr, disp);
if (ret)
return ret;
if (clear_user((void __user *) maddr, disp))
return -EFAULT;
maddr += disp;
}

Expand Down Expand Up @@ -1164,19 +1162,17 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
if (prot & PROT_WRITE && excess1 > 0) {
kdebug("clear[%d] ad=%lx sz=%lx",
loop, maddr + phdr->p_filesz, excess1);
ret = clear_user((void __user *) maddr + phdr->p_filesz,
excess1);
if (ret)
return ret;
if (clear_user((void __user *) maddr + phdr->p_filesz,
excess1))
return -EFAULT;
}

#else
if (excess > 0) {
kdebug("clear[%d] ad=%lx sz=%lx",
loop, maddr + phdr->p_filesz, excess);
ret = clear_user((void *) maddr + phdr->p_filesz, excess);
if (ret)
return ret;
if (clear_user((void *) maddr + phdr->p_filesz, excess))
return -EFAULT;
}
#endif

Expand Down

0 comments on commit 43ee096

Please sign in to comment.