ANDROID: iommu/io-pgtable-arm: Free underlying page tables for large mappings
Consider the case where a 2N--where N > 1--MB buffer is composed entirely of 4 KB pages. This means that at the second to last level, the buffer will have N non-leaf entries that point to page tables with 4 KB mappings. When the buffer is unmapped, all N entries will be cleared at the second to last level. However, the existing logic only checks if it needs to free the underlying page tables for the first non-leaf entry. Therefore, the page table memory for the other entries N-1 entries will be leaked. Fix this memory leak by ensuring that we apply the same check to all N entries that are being unmapped. Bug: 178537788 Fixes: 4ad6f2a4 ("FROMLIST: iommu/io-pgtable-arm: Implement arm_lpae_unmap_pages()") Change-Id: I44cb26296209d1e351b94c763a6b322809c1159a Signed-off-by:Isaac J. Manjarres <isaacm@codeaurora.org>
Loading
Please sign in to comment