There is a possibility that either because of missing device tree entry
or lack of memory, the PA-VA table might not be available. But, the
table being transparent, the callers don't necessary check for its
initialization state. This is explicitly done during update and
translation call.
Fixes:
2f3d633aa593 ("common/dpaax: add library for PA/VA translation table")
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
uintptr_t align_vaddr;
phys_addr_t align_paddr;
+ if (unlikely(dpaax_iova_table_p == NULL))
+ return -1;
+
align_paddr = paddr & DPAAX_MEM_SPLIT_MASK;
align_vaddr = ((uintptr_t)vaddr & DPAAX_MEM_SPLIT_MASK);
size_t offset = paddr & DPAAX_MEM_SPLIT_MASK_OFF;
struct dpaax_iovat_element *entry;
+ if (unlikely(dpaax_iova_table_p == NULL))
+ return NULL;
+
entry = dpaax_iova_table_p->entries;
do {