iommu/amd: Fix pages leak in free_pagetable()

Take into account the gathered freelist in free_sub_pt(), otherwise we
end up leaking all that pages.

Fixes: 409afa44f9 ("iommu/amd: Introduce free_sub_pt() function")
Signed-off-by: Andrei Dulea <adulea@amazon.de>
This commit is contained in:
Andrei Dulea 2019-09-13 16:42:28 +02:00 committed by Joerg Roedel
parent e95adb9add
commit 34c0989c05

View File

@ -1425,7 +1425,7 @@ static void free_pagetable(struct protection_domain *domain)
BUG_ON(domain->mode < PAGE_MODE_NONE ||
domain->mode > PAGE_MODE_6_LEVEL);
free_sub_pt(root, domain->mode, freelist);
freelist = free_sub_pt(root, domain->mode, freelist);
free_page_list(freelist);
}