]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Feb 2016 22:28:34 +0000 (14:28 -0800)
commit84ba3e7dd2dfb617f890f0bd4c27c4f478d13582
tree0c13407462ff2d8c51aa0f007d8c21efdf63a54f
parent459cd75bada64e377cdeb92f1f76f8c474e73e46
iommu/io-pgtable-arm: Ensure we free the final level on teardown

commit 12c2ab09571e8aae3a87da2a4a452632a5fac1e5 upstream.

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.

Reported-by: Zhang Bo <zhangbo_a@xiaomi.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iommu/io-pgtable-arm.c