diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2012-11-21 20:31:52 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2012-11-21 20:31:52 +0100 |
commit | 9c3f9e281697d02889c3b08922f3b30be75f56c2 (patch) | |
tree | e9f3d68e0019a47b982e2b8644f70eb66a3eff3c /kernel/pid_namespace.c | |
parent | b8f61116c1ce342804a0897b0a80eb4df5f19453 (diff) | |
parent | d6ad418763888f617ac5b4849823e4cd670df1dd (diff) |
Merge branch 'fortglx/3.8/time' of git://git.linaro.org/people/jstultz/linux into timers/core
Fix trivial conflicts in: kernel/time/tick-sched.c
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/pid_namespace.c')
-rw-r--r-- | kernel/pid_namespace.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c index eb00be205811..7b07cc0dfb75 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c @@ -71,12 +71,22 @@ err_alloc: return NULL; } +/* MAX_PID_NS_LEVEL is needed for limiting size of 'struct pid' */ +#define MAX_PID_NS_LEVEL 32 + static struct pid_namespace *create_pid_namespace(struct pid_namespace *parent_pid_ns) { struct pid_namespace *ns; unsigned int level = parent_pid_ns->level + 1; - int i, err = -ENOMEM; + int i; + int err; + + if (level > MAX_PID_NS_LEVEL) { + err = -EINVAL; + goto out; + } + err = -ENOMEM; ns = kmem_cache_zalloc(pid_ns_cachep, GFP_KERNEL); if (ns == NULL) goto out; |