aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/drivers/xterm.c2
-rw-r--r--arch/um/os-Linux/helper.c7
2 files changed, 3 insertions, 6 deletions
diff --git a/arch/um/drivers/xterm.c b/arch/um/drivers/xterm.c
index 386f8b952982..850221d9b4c9 100644
--- a/arch/um/drivers/xterm.c
+++ b/arch/um/drivers/xterm.c
@@ -136,8 +136,6 @@ int xterm_open(int input, int output, int primary, void *d,
136 return(pid); 136 return(pid);
137 } 137 }
138 138
139 if(data->stack == 0) free_stack(stack, 0);
140
141 if (data->direct_rcv) { 139 if (data->direct_rcv) {
142 new = os_rcv_fd(fd, &data->helper_pid); 140 new = os_rcv_fd(fd, &data->helper_pid);
143 } else { 141 } else {
diff --git a/arch/um/os-Linux/helper.c b/arch/um/os-Linux/helper.c
index 8a78bf03b468..d13299cfa318 100644
--- a/arch/um/os-Linux/helper.c
+++ b/arch/um/os-Linux/helper.c
@@ -50,7 +50,8 @@ static int helper_child(void *arg)
50} 50}
51 51
52/* Returns either the pid of the child process we run or -E* on failure. 52/* Returns either the pid of the child process we run or -E* on failure.
53 * XXX The alloc_stack here breaks if this is called in the tracing thread */ 53 * XXX The alloc_stack here breaks if this is called in the tracing thread, so
54 * we need to receive a preallocated stack (a local buffer is ok). */
54int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv, 55int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
55 unsigned long *stack_out) 56 unsigned long *stack_out)
56{ 57{
@@ -113,10 +114,8 @@ out_close:
113 close(fds[1]); 114 close(fds[1]);
114 close(fds[0]); 115 close(fds[0]);
115out_free: 116out_free:
116 if (stack_out == NULL) 117 if ((stack_out == NULL) || (*stack_out == 0))
117 free_stack(stack, 0); 118 free_stack(stack, 0);
118 else
119 *stack_out = stack;
120 return ret; 119 return ret;
121} 120}
122 121