Skip to contentSkip to conversation

common/dpaax: fix possible null pointer access

PATCH Applied Min Hu (Connor) 3 participants 3 messages Apr 21, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/dpaax: fix possible null pointer access

From: Chengwen Feng <[email protected]>

This patch fixes possible null pointer access when dump iova table.

Fixes 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table")
---
 drivers/common/dpaax/dpaax_iova_table.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/common/dpaax/dpaax_iova_table.c +3 -1
index 91bee65..54f89e1 100644
@@ -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++) {
Signature · 1 line
2.7.4
Acked-by on v1 1/1
#1 lore raw
Quoted 19 lines · Min Hu (Connor)

From: Chengwen Feng <[email protected]>

This patch fixes possible null pointer access when dump iova table.

Fixes 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table")
---
  drivers/common/dpaax/dpaax_iova_table.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/common/dpaax/dpaax_iova_table.c +0 -0
index 91bee65..54f89e1 100644
@@ -366,8 +366,10 @@ dpaax_iova_table_dump(void)
  	}

drivers/common/dpaax/dpaax_iova_table.c dpaax_iova_table_dump(void) · line 375

Quoted 10 lines
drivers/common/dpaax/dpaax_iova_table.c +3 -1
 
  	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 lore raw

21/04/2021 14:12, Hemant Agrawal:

Quoted 11 lines · Min Hu (Connor)
Quoted 9 lines

From: Chengwen Feng <[email protected]>

This patch fixes possible null pointer access when dump iova table.

Fixes 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table")

Applied, thanks