do_brk's return value was stored in an unsigned long variable before being
tested for less than zero making the test always fail. Also do_brk's
called irix_map_prda_page wasn't forwarding do_brk() success.
Bug checking the return value of do_brk() and initial fix for it found
by Roel Kluin <12o3l@tiscali.nl>.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* process and the system, here we map the page and fill the
* structure
*/
* 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;
{
unsigned long v;
struct prda *pp;
v = do_brk(PRDA_ADDRESS, PAGE_SIZE);
up_write(¤t->mm->mmap_sem);
v = do_brk(PRDA_ADDRESS, PAGE_SIZE);
up_write(¤t->mm->mmap_sem);
+ 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);
pp = (struct prda *) v;
pp->prda_sys.t_pid = task_pid_vnr(current);
pp->prda_sys.t_rpid = task_pid_vnr(current);
/* We leave the rest set to zero */
pp->prda_sys.t_rpid = task_pid_vnr(current);
/* We leave the rest set to zero */
* IRIX maps a page at 0x200000 which holds some system
* information. Programs depend on this.
*/
* IRIX maps a page at 0x200000 which holds some system
* information. Programs depend on this.
*/
+ if (irix_map_prda_page())
+ goto out_free_dentry;