All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] c/r: alloc_pid() should return -ENOMEM on failure
@ 2009-08-19 19:46 Sukadev Bhattiprolu
       [not found] ` <20090819194654.GA22851-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Sukadev Bhattiprolu @ 2009-08-19 19:46 UTC (permalink / raw)
  To: Oren Laadan; +Cc: Containers


The clone_with_pids() patchset changed alloc_pid() to return an error
code in the pointer. alloc_pid() should then return -ENOMEM rather than
NULL when memory allocations fails.

Signed-off-by: Sukadev Bhattiprolu <sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

Index: linux-cr/kernel/pid.c
===================================================================
--- linux-cr.orig/kernel/pid.c	2009-08-19 12:43:45.000000000 -0700
+++ linux-cr/kernel/pid.c	2009-08-19 12:45:33.000000000 -0700
@@ -290,8 +290,10 @@
 	int tpid;
 
 	pid = kmem_cache_alloc(ns->pid_cachep, GFP_KERNEL);
-	if (!pid)
+	if (!pid) {
+		pid = ERR_PTR(-ENOMEM);
 		goto out;
+	}
 
 	tmp = ns;
 	for (i = ns->level; i >= 0; i--) {

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] c/r: alloc_pid() should return -ENOMEM on failure
       [not found] ` <20090819194654.GA22851-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2009-08-25  5:53   ` Oren Laadan
  0 siblings, 0 replies; 2+ messages in thread
From: Oren Laadan @ 2009-08-25  5:53 UTC (permalink / raw)
  To: Sukadev Bhattiprolu; +Cc: Containers


Added, thanks.

Sukadev Bhattiprolu wrote:
> The clone_with_pids() patchset changed alloc_pid() to return an error
> code in the pointer. alloc_pid() should then return -ENOMEM rather than
> NULL when memory allocations fails.
> 
> Signed-off-by: Sukadev Bhattiprolu <sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> 
> Index: linux-cr/kernel/pid.c
> ===================================================================
> --- linux-cr.orig/kernel/pid.c	2009-08-19 12:43:45.000000000 -0700
> +++ linux-cr/kernel/pid.c	2009-08-19 12:45:33.000000000 -0700
> @@ -290,8 +290,10 @@
>  	int tpid;
>  
>  	pid = kmem_cache_alloc(ns->pid_cachep, GFP_KERNEL);
> -	if (!pid)
> +	if (!pid) {
> +		pid = ERR_PTR(-ENOMEM);
>  		goto out;
> +	}
>  
>  	tmp = ns;
>  	for (i = ns->level; i >= 0; i--) {
> _______________________________________________
> Containers mailing list
> Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
> https://lists.linux-foundation.org/mailman/listinfo/containers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-25  5:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-19 19:46 [PATCH] c/r: alloc_pid() should return -ENOMEM on failure Sukadev Bhattiprolu
     [not found] ` <20090819194654.GA22851-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-08-25  5:53   ` Oren Laadan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.