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

Commit e94d6c56 authored by Shiraz Hashim's avatar Shiraz Hashim
Browse files

iommu/io-pgtable-fast: validate data before use



Return error on data allocation failure to prevent use
after free case.

Change-Id: I9d173756e277c9006220c02c209309167f179609
Signed-off-by: default avatarShiraz Hashim <shashim@codeaurora.org>
parent ad8cf1bb
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -424,6 +424,9 @@ av8l_fast_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie)
	struct av8l_fast_io_pgtable *data =
		av8l_fast_alloc_pgtable_data(cfg);

	if (!data)
		return NULL;

	/* restrict according to the fast map requirements */
	cfg->ias = 32;
	cfg->pgsize_bitmap = SZ_4K;