Skip to contentSkip to conversation

syslets demo - fix malloc failure check

PATCH New Jeff Dike 1 participant 1 message Jun 3, 2007 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 1/1 syslets demo - fix malloc failure check

Fix the stack malloc failure check.

--

 syslets/async-test-v5/sys.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
syslets/async-test-v5/sys.h +2 -1
Index: linux-2.6/syslets/async-test-v5/sys.h
===================================================================
@@ -108,9 +108,10 @@ static u64 completion_ring[MAX_PENDING];
 
 static unsigned long thread_stack_alloc()
 {
-	void *stack = malloc(THREAD_STACK_SIZE) + THREAD_STACK_SIZE;
+	void *stack = malloc(THREAD_STACK_SIZE);
 	assert(stack != NULL);
 
+	stack += THREAD_STACK_SIZE;
 	pr("allocated stack: %p\n", stack);
 
 	return (unsigned long)stack;

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel