Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99b3982b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "iommu/io-pgtable: fix __arm_lpae_free_pgtable leak"

parents 41e2dab4 cc36f8e9
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -469,10 +469,6 @@ static void __arm_lpae_free_pgtable(struct arm_lpae_io_pgtable *data, int lvl,
	arm_lpae_iopte *start, *end;
	unsigned long table_size;

	/* Only leaf entries at the last level */
	if (lvl == ARM_LPAE_MAX_LEVELS - 1)
		return;

	if (lvl == ARM_LPAE_START_LVL(data))
		table_size = data->pgd_size;
	else
@@ -481,6 +477,10 @@ static void __arm_lpae_free_pgtable(struct arm_lpae_io_pgtable *data, int lvl,
	start = ptep;
	end = (void *)ptep + table_size;

	/* Only leaf entries at the last level */
	if (lvl == ARM_LPAE_MAX_LEVELS - 1)
		goto end;

	while (ptep != end) {
		arm_lpae_iopte pte = *ptep++;

@@ -490,6 +490,7 @@ static void __arm_lpae_free_pgtable(struct arm_lpae_io_pgtable *data, int lvl,
		__arm_lpae_free_pgtable(data, lvl + 1, iopte_deref(pte, data));
	}

end:
	io_pgtable_free_pages_exact(&data->iop.cfg, data->iop.cookie,
				    start, table_size);
}