diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/pid.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/pid.c b/kernel/pid.c index d3f722d20f9c..55fd5900bac8 100644 --- a/kernel/pid.c +++ b/kernel/pid.c | |||
@@ -141,11 +141,12 @@ static int alloc_pidmap(struct pid_namespace *pid_ns) | |||
141 | * installing it: | 141 | * installing it: |
142 | */ | 142 | */ |
143 | spin_lock_irq(&pidmap_lock); | 143 | spin_lock_irq(&pidmap_lock); |
144 | if (map->page) | 144 | if (!map->page) { |
145 | kfree(page); | ||
146 | else | ||
147 | map->page = page; | 145 | map->page = page; |
146 | page = NULL; | ||
147 | } | ||
148 | spin_unlock_irq(&pidmap_lock); | 148 | spin_unlock_irq(&pidmap_lock); |
149 | kfree(page); | ||
149 | if (unlikely(!map->page)) | 150 | if (unlikely(!map->page)) |
150 | break; | 151 | break; |
151 | } | 152 | } |