|
@@ -990,10 +990,9 @@ static int elf_fdpic_map_file_constdisp_on_uclinux(
|
|
|
|
|
|
/* clear any space allocated but not loaded */
|
|
/* clear any space allocated but not loaded */
|
|
if (phdr->p_filesz < phdr->p_memsz) {
|
|
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) {
|
|
if (mm) {
|
|
@@ -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_fdpic_loadseg *seg;
|
|
struct elf32_phdr *phdr;
|
|
struct elf32_phdr *phdr;
|
|
unsigned long load_addr, delta_vaddr;
|
|
unsigned long load_addr, delta_vaddr;
|
|
- int loop, dvset, ret;
|
|
|
|
|
|
+ int loop, dvset;
|
|
|
|
|
|
load_addr = params->load_addr;
|
|
load_addr = params->load_addr;
|
|
delta_vaddr = 0;
|
|
delta_vaddr = 0;
|
|
@@ -1127,9 +1126,8 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
|
|
* PT_LOAD */
|
|
* PT_LOAD */
|
|
if (prot & PROT_WRITE && disp > 0) {
|
|
if (prot & PROT_WRITE && disp > 0) {
|
|
kdebug("clear[%d] ad=%lx sz=%lx", loop, maddr, disp);
|
|
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;
|
|
maddr += disp;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1164,19 +1162,17 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
|
|
if (prot & PROT_WRITE && excess1 > 0) {
|
|
if (prot & PROT_WRITE && excess1 > 0) {
|
|
kdebug("clear[%d] ad=%lx sz=%lx",
|
|
kdebug("clear[%d] ad=%lx sz=%lx",
|
|
loop, maddr + phdr->p_filesz, excess1);
|
|
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
|
|
#else
|
|
if (excess > 0) {
|
|
if (excess > 0) {
|
|
kdebug("clear[%d] ad=%lx sz=%lx",
|
|
kdebug("clear[%d] ad=%lx sz=%lx",
|
|
loop, maddr + phdr->p_filesz, excess);
|
|
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
|
|
#endif
|
|
|
|
|