From: Chengwen Feng <fengcheng...@huawei.com> This patch fixes possible null pointer access when dump iova table.
Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table") Cc: sta...@dpdk.org Signed-off-by: Chengwen Feng <fengcheng...@huawei.com> Signed-off-by: Min Hu (Connor) <humi...@huawei.com> --- drivers/common/dpaax/dpaax_iova_table.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c index 91bee65..54f89e1 100644 --- a/drivers/common/dpaax/dpaax_iova_table.c +++ b/drivers/common/dpaax/dpaax_iova_table.c @@ -366,8 +366,10 @@ dpaax_iova_table_dump(void) } DPAAX_DEBUG(" === Start of PA->VA Translation Table ==="); - if (dpaax_iova_table_p == NULL) + if (dpaax_iova_table_p == NULL) { DPAAX_DEBUG("\tNULL"); + return; + } entry = dpaax_iova_table_p->entries; for (i = 0; i < dpaax_iova_table_p->count; i++) { -- 2.7.4