From 9416b9754c8e69fda07bf3189c9f07ec3fdcf994 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sat, 26 Mar 2016 10:03:33 +0100 Subject: [PATCH] some code cleanups --- hermit/kernel/syscall.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hermit/kernel/syscall.c b/hermit/kernel/syscall.c index 5f69c01bb..c9d289ddf 100644 --- a/hermit/kernel/syscall.c +++ b/hermit/kernel/syscall.c @@ -219,14 +219,13 @@ ssize_t sys_sbrk(ssize_t incr) vma_t* heap = per_core(current_task)->heap; static spinlock_t heap_lock = SPINLOCK_INIT; - spinlock_lock(&heap_lock); - if (BUILTIN_EXPECT(!heap, 0)) { - spinlock_unlock(&heap_lock); kprintf("sys_sbrk: missing heap!\n"); do_abort(); } + spinlock_lock(&heap_lock); + ret = heap->end; heap->end += incr; if (heap->end < heap->start)