diff options
Diffstat (limited to 'kernel/pid.c')
-rw-r--r-- | kernel/pid.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/pid.c b/kernel/pid.c index 39b65b69584f..57a8346a270e 100644 --- a/kernel/pid.c +++ b/kernel/pid.c | |||
@@ -217,11 +217,14 @@ static int alloc_pidmap(struct pid_namespace *pid_ns) | |||
217 | return -1; | 217 | return -1; |
218 | } | 218 | } |
219 | 219 | ||
220 | int next_pidmap(struct pid_namespace *pid_ns, int last) | 220 | int next_pidmap(struct pid_namespace *pid_ns, unsigned int last) |
221 | { | 221 | { |
222 | int offset; | 222 | int offset; |
223 | struct pidmap *map, *end; | 223 | struct pidmap *map, *end; |
224 | 224 | ||
225 | if (last >= PID_MAX_LIMIT) | ||
226 | return -1; | ||
227 | |||
225 | offset = (last + 1) & BITS_PER_PAGE_MASK; | 228 | offset = (last + 1) & BITS_PER_PAGE_MASK; |
226 | map = &pid_ns->pidmap[(last + 1)/BITS_PER_PAGE]; | 229 | map = &pid_ns->pidmap[(last + 1)/BITS_PER_PAGE]; |
227 | end = &pid_ns->pidmap[PIDMAP_ENTRIES]; | 230 | end = &pid_ns->pidmap[PIDMAP_ENTRIES]; |
@@ -435,6 +438,7 @@ struct pid *get_task_pid(struct task_struct *task, enum pid_type type) | |||
435 | rcu_read_unlock(); | 438 | rcu_read_unlock(); |
436 | return pid; | 439 | return pid; |
437 | } | 440 | } |
441 | EXPORT_SYMBOL_GPL(get_task_pid); | ||
438 | 442 | ||
439 | struct task_struct *get_pid_task(struct pid *pid, enum pid_type type) | 443 | struct task_struct *get_pid_task(struct pid *pid, enum pid_type type) |
440 | { | 444 | { |
@@ -446,6 +450,7 @@ struct task_struct *get_pid_task(struct pid *pid, enum pid_type type) | |||
446 | rcu_read_unlock(); | 450 | rcu_read_unlock(); |
447 | return result; | 451 | return result; |
448 | } | 452 | } |
453 | EXPORT_SYMBOL_GPL(get_pid_task); | ||
449 | 454 | ||
450 | struct pid *find_get_pid(pid_t nr) | 455 | struct pid *find_get_pid(pid_t nr) |
451 | { | 456 | { |