public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix check for return value of create_pid_namespace
@ 2007-08-17  9:25 Pavel Emelyanov
  0 siblings, 0 replies; only message in thread
From: Pavel Emelyanov @ 2007-08-17  9:25 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Alexey Dobriyan, Sukadev Bhattiprolu, Linux Containers,
	Oleg Nesterov, Linux Kernel Mailing List, devel

The function in question returns ERR_PTR-s to indicate the
error, while the caller checks for return value to be NULL.

Found during testing the OpenVZ kernel with pid namespaces.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org>
Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>

---
 kernel/pid.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/pid.c b/kernel/pid.c
index faad017..cb1f3cb 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -543,7 +543,7 @@ struct pid_namespace *copy_pid_ns(unsign
 		goto out_put;
 
 	new_ns = create_pid_namespace(old_ns->level + 1);
-	if (new_ns != NULL)
+	if (!IS_ERR(new_ns))
 		new_ns->parent = get_pid_ns(old_ns);
 
 out_put:

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

only message in thread, other threads:[~2007-08-17  9:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-17  9:25 [PATCH] Fix check for return value of create_pid_namespace Pavel Emelyanov

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