|
@@ -217,11 +217,14 @@ static int alloc_pidmap(struct pid_namespace *pid_ns)
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
|
|
-int next_pidmap(struct pid_namespace *pid_ns, int last)
|
|
|
|
|
|
+int next_pidmap(struct pid_namespace *pid_ns, unsigned int last)
|
|
{
|
|
{
|
|
int offset;
|
|
int offset;
|
|
struct pidmap *map, *end;
|
|
struct pidmap *map, *end;
|
|
|
|
|
|
|
|
+ if (last >= PID_MAX_LIMIT)
|
|
|
|
+ return -1;
|
|
|
|
+
|
|
offset = (last + 1) & BITS_PER_PAGE_MASK;
|
|
offset = (last + 1) & BITS_PER_PAGE_MASK;
|
|
map = &pid_ns->pidmap[(last + 1)/BITS_PER_PAGE];
|
|
map = &pid_ns->pidmap[(last + 1)/BITS_PER_PAGE];
|
|
end = &pid_ns->pidmap[PIDMAP_ENTRIES];
|
|
end = &pid_ns->pidmap[PIDMAP_ENTRIES];
|