mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
Wrong page freed on preallocate_pmds() failure exit
Note that pmds[i] is simply uninitialized at that point...
Granted, it's very hard to hit (you need split page locks *and*
kmalloc(sizeof(spinlock_t), GFP_KERNEL) failing), but the code is
obviously bogus.
Introduced by commit 09ef493985
("x86: add missed
pgtable_pmd_page_ctor/dtor calls for preallocated pmds")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
82023bb7f7
commit
2a46eed54a
1 changed files with 1 additions and 1 deletions
|
@ -209,7 +209,7 @@ static int preallocate_pmds(pmd_t *pmds[])
|
|||
if (!pmd)
|
||||
failed = true;
|
||||
if (pmd && !pgtable_pmd_page_ctor(virt_to_page(pmd))) {
|
||||
free_page((unsigned long)pmds[i]);
|
||||
free_page((unsigned long)pmd);
|
||||
pmd = NULL;
|
||||
failed = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue