]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iommu/io-pgtable-arm: Ensure we free the final level on teardown
authorWill Deacon <will.deacon@arm.com>
Tue, 15 Dec 2015 16:08:12 +0000 (16:08 +0000)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 1 Feb 2016 16:40:02 +0000 (11:40 -0500)
commitbf0a6a9a3d53615aee7a3e04c12f88fdd3fc1d4c
tree458a77a4458ca7d1e12d6aba551862a4a0f19d9c
parent94fde0abd09b14f0e50efe87edb36ec0d1e88510
iommu/io-pgtable-arm: Ensure we free the final level on teardown

[ Upstream commit 12c2ab09571e8aae3a87da2a4a452632a5fac1e5 ]

When tearing down page tables, we return early for the final level
since we know that we won't have any table pointers to follow.
Unfortunately, this also means that we forget to free the final level,
so we end up leaking memory.

Fix the issue by always freeing the current level, but just don't bother
to iterate over the ptes if we're at the final level.

Cc: <stable@vger.kernel.org>
Reported-by: Zhang Bo <zhangbo_a@xiaomi.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/iommu/io-pgtable-arm.c