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:
9d37e66
)
parisc: mm: Fix a memory leak related to pmd not attached to the pgd
author
Christophe Jaillet
<
[email protected]
>
Mon, 13 Jul 2015 09:32:43 +0000
(11:32 +0200)
committer
Helge Deller
<
[email protected]
>
Sun, 19 Jul 2015 06:56:14 +0000
(08:56 +0200)
Commit
0e0da48dee8d
("parisc: mm: don't count preallocated pmds")
introduced a memory leak.
After this commit, the 'return' statement in pmd_free is executed in all
cases. Even for pmd that are not attached to the pgd. So 'free_pages'
can never be called anymore, leading to a memory leak.
Signed-off-by: Christophe JAILLET <
[email protected]
>
Acked-by: Kirill A. Shutemov <
[email protected]
>
Acked-by: Mikulas Patocka <
[email protected]
>
Acked-by: Helge Deller <
[email protected]
>
Cc:
[email protected]
# v4.0+
Signed-off-by: Helge Deller <
[email protected]
>
arch/parisc/include/asm/pgalloc.h
patch
|
blob
|
history
diff --git
a/arch/parisc/include/asm/pgalloc.h
b/arch/parisc/include/asm/pgalloc.h
index 3a08eae3318fe8da341a563613ae16e82e64912b..3edbb9fc91b4e055307d3c7519592a00201d988a 100644
(file)
--- a/
arch/parisc/include/asm/pgalloc.h
+++ b/
arch/parisc/include/asm/pgalloc.h
@@
-72,7
+72,7
@@
static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
{
- if
(pmd_flag(*pmd) & PxD_FLAG_ATTACHED)
+ if
(pmd_flag(*pmd) & PxD_FLAG_ATTACHED) {
/*
* This is the permanent pmd attached to the pgd;
* cannot free it.
@@
-81,6
+81,7
@@
static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
*/
mm_inc_nr_pmds(mm);
return;
+ }
free_pages((unsigned long)pmd, PMD_ORDER);
}