parisc: mm: Fix a memory leak related to pmd not attached to the pgd
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Mon, 13 Jul 2015 09:32:43 +0000 (11:32 +0200)
committerHelge Deller <deller@gmx.de>
Sun, 19 Jul 2015 06:56:14 +0000 (08:56 +0200)
commit4c4ac9a48ac512c6b5a6cca06cfad2ad96e8caaa
tree7e721e9391aafea6b902fb25d65ce967d910c35e
parent9d37e6679dfddbb5fa605fb2d7ff448f7cd6d038
parisc: mm: Fix a memory leak related to pmd not attached to the pgd

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 <christophe.jaillet@wanadoo.fr>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org # v4.0+
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/include/asm/pgalloc.h