diff options
Diffstat (limited to 'arch/um/kernel/skas/process.c')
-rw-r--r-- | arch/um/kernel/skas/process.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/arch/um/kernel/skas/process.c b/arch/um/kernel/skas/process.c index fce389c2342f..2e9852c0d487 100644 --- a/arch/um/kernel/skas/process.c +++ b/arch/um/kernel/skas/process.c | |||
@@ -6,19 +6,25 @@ | |||
6 | #include "linux/init.h" | 6 | #include "linux/init.h" |
7 | #include "linux/sched.h" | 7 | #include "linux/sched.h" |
8 | #include "as-layout.h" | 8 | #include "as-layout.h" |
9 | #include "kern.h" | ||
9 | #include "os.h" | 10 | #include "os.h" |
10 | #include "skas.h" | 11 | #include "skas.h" |
11 | 12 | ||
12 | int new_mm(unsigned long stack) | 13 | int new_mm(unsigned long stack) |
13 | { | 14 | { |
14 | int fd; | 15 | int fd, err; |
15 | 16 | ||
16 | fd = os_open_file("/proc/mm", of_cloexec(of_write(OPENFLAGS())), 0); | 17 | fd = os_open_file("/proc/mm", of_cloexec(of_write(OPENFLAGS())), 0); |
17 | if (fd < 0) | 18 | if (fd < 0) |
18 | return fd; | 19 | return fd; |
19 | 20 | ||
20 | if (skas_needs_stub) | 21 | if (skas_needs_stub) { |
21 | map_stub_pages(fd, STUB_CODE, STUB_DATA, stack); | 22 | err = map_stub_pages(fd, STUB_CODE, STUB_DATA, stack); |
23 | if (err) { | ||
24 | os_close_file(fd); | ||
25 | return err; | ||
26 | } | ||
27 | } | ||
22 | 28 | ||
23 | return fd; | 29 | return fd; |
24 | } | 30 | } |
@@ -49,8 +55,14 @@ int __init start_uml(void) | |||
49 | { | 55 | { |
50 | stack_protections((unsigned long) &cpu0_irqstack); | 56 | stack_protections((unsigned long) &cpu0_irqstack); |
51 | set_sigstack(cpu0_irqstack, THREAD_SIZE); | 57 | set_sigstack(cpu0_irqstack, THREAD_SIZE); |
52 | if (proc_mm) | 58 | if (proc_mm) { |
53 | userspace_pid[0] = start_userspace(0); | 59 | userspace_pid[0] = start_userspace(0); |
60 | if (userspace_pid[0] < 0) { | ||
61 | printf("start_uml - start_userspace returned %d\n", | ||
62 | userspace_pid[0]); | ||
63 | exit(1); | ||
64 | } | ||
65 | } | ||
54 | 66 | ||
55 | init_new_thread_signals(); | 67 | init_new_thread_signals(); |
56 | 68 | ||