iommu: pcie: Fix incorrect kmemleak_ignore() usage

kmemleak_ignore() shouldn't be used on the gen_pool allocations since they
aren't slab allocations. This leads to a flurry of warnings from kmemleak;
fix it by using kmemleak_ignore() correctly.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
This commit is contained in:
Sultan Alsawaf 2023-03-30 14:01:41 -07:00 committed by Ksawlii
parent 2f43de3476
commit c3807312b1

View file

@ -691,6 +691,7 @@ static sysmmu_pte_t *alloc_lv2entry(struct exynos_iommu_domain *domain,
if (!pent)
return ERR_PTR(-ENOMEM);
}
kmemleak_ignore(pent);
#else /* Use genpool */
if (gen_pool_avail(lv2table_pool) >= LV2TABLE_AND_REFBUF_SZ) {
pent = phys_to_virt(gen_pool_alloc(lv2table_pool,
@ -700,6 +701,7 @@ static sysmmu_pte_t *alloc_lv2entry(struct exynos_iommu_domain *domain,
pent = kmem_cache_zalloc(lv2table_kmem_cache, gfpmask);
if (!pent)
return ERR_PTR(-ENOMEM);
kmemleak_ignore(pent);
}
#endif
@ -707,7 +709,6 @@ static sysmmu_pte_t *alloc_lv2entry(struct exynos_iommu_domain *domain,
pgtable_flush(sent, sent + 1);
pgtable_flush(pent, pent + NUM_LV2ENTRIES);
atomic_set(pgcounter, NUM_LV2ENTRIES);
kmemleak_ignore(pent);
}
return page_entry(sent, iova);