projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
762216a
)
mm/mremap.c: call pud_free() after fail calling pmd_alloc()
author
Chen Gang
<
[email protected]
>
Wed, 11 Sep 2013 21:22:43 +0000
(14:22 -0700)
committer
Linus Torvalds
<
[email protected]
>
Wed, 11 Sep 2013 22:58:03 +0000
(15:58 -0700)
In alloc_new_pmd(), if pud_alloc() was called successfully, but
pmd_alloc() fails, avoid leaking `pud'.
Signed-off-by: Chen Gang <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
mm/mremap.c
patch
|
blob
|
history
diff --git
a/mm/mremap.c
b/mm/mremap.c
index 0843feb66f3d0236abd4386b5bfd0170c24ae0ef..91b13d6a16d453b50894e6028800b92399bf8f14 100644
(file)
--- a/
mm/mremap.c
+++ b/
mm/mremap.c
@@
-25,6
+25,7
@@
#include <asm/uaccess.h>
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
+#include <asm/pgalloc.h>
#include "internal.h"
@@
-62,8
+63,10
@@
static pmd_t *alloc_new_pmd(struct mm_struct *mm, struct vm_area_struct *vma,
return NULL;
pmd = pmd_alloc(mm, pud, addr);
- if (!pmd)
+ if (!pmd) {
+ pud_free(mm, pud);
return NULL;
+ }
VM_BUG_ON(pmd_trans_huge(*pmd));