git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit 'v2.6.27-rc3' into x86/xsave
[safe/jmp/linux-2.6]
/
kernel
/
utsname.c
diff --git
a/kernel/utsname.c
b/kernel/utsname.c
index
160c8c5
..
64d398f
100644
(file)
--- a/
kernel/utsname.c
+++ b/
kernel/utsname.c
@@
-13,6
+13,8
@@
#include <linux/uts.h>
#include <linux/utsname.h>
#include <linux/version.h>
#include <linux/uts.h>
#include <linux/utsname.h>
#include <linux/version.h>
+#include <linux/err.h>
+#include <linux/slab.h>
/*
* Clone a new ns copying an original utsname, setting refcount to 1
/*
* Clone a new ns copying an original utsname, setting refcount to 1
@@
-24,10
+26,13
@@
static struct uts_namespace *clone_uts_ns(struct uts_namespace *old_ns)
struct uts_namespace *ns;
ns = kmalloc(sizeof(struct uts_namespace), GFP_KERNEL);
struct uts_namespace *ns;
ns = kmalloc(sizeof(struct uts_namespace), GFP_KERNEL);
- if (ns) {
- memcpy(&ns->name, &old_ns->name, sizeof(ns->name));
- kref_init(&ns->kref);
- }
+ if (!ns)
+ return ERR_PTR(-ENOMEM);
+
+ down_read(&uts_sem);
+ memcpy(&ns->name, &old_ns->name, sizeof(ns->name));
+ up_read(&uts_sem);
+ kref_init(&ns->kref);
return ns;
}
return ns;
}
@@
-37,7
+42,7
@@
static struct uts_namespace *clone_uts_ns(struct uts_namespace *old_ns)
* utsname of this process won't be seen by parent, and vice
* versa.
*/
* utsname of this process won't be seen by parent, and vice
* versa.
*/
-struct uts_namespace *copy_utsname(
int
flags, struct uts_namespace *old_ns)
+struct uts_namespace *copy_utsname(
unsigned long
flags, struct uts_namespace *old_ns)
{
struct uts_namespace *new_ns;
{
struct uts_namespace *new_ns;