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:
parent
87b1536fb3
commit
81218366f1
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue