public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] syslets demo - fix malloc failure check
@ 2007-06-03 17:15 Jeff Dike
  0 siblings, 0 replies; only message in thread
From: Jeff Dike @ 2007-06-03 17:15 UTC (permalink / raw)
  To: Zach Brown, Ingo Molnar; +Cc: LKML, uml-devel

Fix the stack malloc failure check.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
--
 syslets/async-test-v5/sys.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6/syslets/async-test-v5/sys.h
===================================================================
--- linux-2.6.orig/syslets/async-test-v5/sys.h	2007-05-31 13:29:57.000000000 -0400
+++ linux-2.6/syslets/async-test-v5/sys.h	2007-06-03 13:12:43.000000000 -0400
@@ -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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-06-03 17:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-03 17:15 [PATCH] syslets demo - fix malloc failure check Jeff Dike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox