diff mbox series

common/dpaax: fix possible null pointer access

Message ID 1618973213-25718-1-git-send-email-humin29@huawei.com (mailing list archive)
State Accepted
Delegated to: Thomas Monjalon
Headers show
Series common/dpaax: fix possible null pointer access | expand

Checks

Context Check Description
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues
ci/github-robot success github build: passed
ci/checkpatch success coding style OK

Commit Message

Min Hu (Connor) April 21, 2021, 2:46 a.m. UTC
From: Chengwen Feng <fengchengwen@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: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/common/dpaax/dpaax_iova_table.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Hemant Agrawal April 21, 2021, 12:12 p.m. UTC | #1
On 4/21/2021 8:16 AM, Min Hu (Connor) wrote:
> From: Chengwen Feng <fengchengwen@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: stable@dpdk.org
>
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@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++) {
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Thomas Monjalon April 21, 2021, 3:03 p.m. UTC | #2
21/04/2021 14:12, Hemant Agrawal:
> On 4/21/2021 8:16 AM, Min Hu (Connor) wrote:
> > From: Chengwen Feng <fengchengwen@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: stable@dpdk.org
> >
> > Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> > Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Applied, thanks
diff mbox series

Patch

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++) {