summaryrefslogtreecommitdiff
path: root/mach/setup-thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'mach/setup-thread.c')
-rw-r--r--mach/setup-thread.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mach/setup-thread.c b/mach/setup-thread.c
index 1505027feb..c1de3a1fb6 100644
--- a/mach/setup-thread.c
+++ b/mach/setup-thread.c
@@ -88,16 +88,16 @@ __mach_setup_tls (thread_t thread)
mach_msg_type_number_t tssize = MACHINE_THREAD_STATE_COUNT;
tcbhead_t *tcb;
+ tcb = _dl_allocate_tls (NULL);
+ if (tcb == NULL)
+ return KERN_RESOURCE_SHORTAGE;
+
if (error = __thread_get_state (thread, MACHINE_THREAD_STATE_FLAVOR,
(natural_t *) &ts, &tssize))
return error;
assert (tssize == MACHINE_THREAD_STATE_COUNT);
- tcb = _dl_allocate_tls(NULL);
- if (!tcb)
- return KERN_RESOURCE_SHORTAGE;
-
- _hurd_tls_new(thread, &ts, tcb);
+ _hurd_tls_new (thread, &ts, tcb);
error = __thread_set_state (thread, MACHINE_THREAD_STATE_FLAVOR,
(natural_t *) &ts, tssize);