When allocating a stack for a new process using the user-sapce allocator, need to select the address environment first

This commit is contained in:
Gregory Nutt
2014-09-09 17:32:32 -06:00
parent c40e60ac65
commit 76957599a2
2 changed files with 32 additions and 6 deletions
+5 -5
View File
@@ -93,13 +93,13 @@ static inline int exec_dtors(FAR struct binary_s *binp)
#endif
int i;
/* Instantiate the address enviroment containing the destructors */
/* Instantiate the address environment containing the destructors */
#ifdef CONFIG_ARCH_ADDRENV
ret = up_addrenv_select(binp->addrenv, &oldenv);
ret = up_addrenv_select(&binp->addrenv, &oldenv);
if (ret < 0)
{
bdbg("up_addrenv_select() failed: %d\n", ret);
bdbg("ERROR: up_addrenv_select() failed: %d\n", ret);
return ret;
}
#endif
@@ -114,10 +114,10 @@ static inline int exec_dtors(FAR struct binary_s *binp)
dtor++;
}
/* Restore the address enviroment */
/* Restore the address environment */
#ifdef CONFIG_ARCH_ADDRENV
return up_addrenv_restore(oldenv);
return up_addrenv_restore(&oldenv);
#else
return OK;
#endif