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: Shiraz Hashim <shashim@codeaurora.org>
This commit is contained in:
Shiraz Hashim 2016-07-04 15:05:14 +05:30 committed by Kyle Yan
parent 87b1536fb3
commit 81218366f1

View file

@ -420,6 +420,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;