]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/mips/kernel/irixelf.c
Merge commit 'v2.6.26-rc8' into x86/xen
[linux-2.6-omap-h63xx.git] / arch / mips / kernel / irixelf.c
index 290d8e3a664d71bd71e2fb582dd004025a06b34d..469c7237e5baf4f3e7b1acc3b32bcde5fb319955 100644 (file)
@@ -578,7 +578,7 @@ static inline int map_interpreter(struct elf_phdr *epp, struct elfhdr *ihp,
  * process and the system, here we map the page and fill the
  * structure
  */
-static void irix_map_prda_page(void)
+static int irix_map_prda_page(void)
 {
        unsigned long v;
        struct prda *pp;
@@ -587,8 +587,8 @@ static void irix_map_prda_page(void)
        v =  do_brk(PRDA_ADDRESS, PAGE_SIZE);
        up_write(&current->mm->mmap_sem);
 
-       if (v < 0)
-               return;
+       if (v != PRDA_ADDRESS)
+               return v;               /* v must be an error code */
 
        pp = (struct prda *) v;
        pp->prda_sys.t_pid  = task_pid_vnr(current);
@@ -596,6 +596,8 @@ static void irix_map_prda_page(void)
        pp->prda_sys.t_rpid = task_pid_vnr(current);
 
        /* We leave the rest set to zero */
+
+       return 0;
 }
 
 
@@ -781,7 +783,8 @@ static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs)
         * IRIX maps a page at 0x200000 which holds some system
         * information.  Programs depend on this.
         */
-       irix_map_prda_page();
+       if (irix_map_prda_page())
+               goto out_free_dentry;
 
        padzero(elf_bss);