diff mbox series

[3/3] dmap/dpaa2: remove unnecessary null check

Message ID 20220622185158.397779-4-stephen@networkplumber.org (mailing list archive)
State Accepted
Delegated to: David Marchand
Headers show
Series more null pointer check removal | expand


Context Check Description
ci/iol-abi-testing warning Testing issues
ci/github-robot: build success github build: passed
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger June 22, 2022, 6:51 p.m. UTC
The function rte_free already handles being called with NULL.
Found by nullfree.cocci.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
 drivers/dma/dpaa2/dpaa2_qdma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series


diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c
index a93a60565df7..0500e8c22590 100644
--- a/drivers/dma/dpaa2/dpaa2_qdma.c
+++ b/drivers/dma/dpaa2/dpaa2_qdma.c
@@ -1404,11 +1404,9 @@  dpaa2_qdma_reset(struct rte_dma_dev *dev)
 	/* Reset and free virtual queues */
 	for (i = 0; i < qdma_dev->num_vqs; i++) {
-		if (qdma_dev->vqs[i].status_ring)
-			rte_ring_free(qdma_dev->vqs[i].status_ring);
+		rte_ring_free(qdma_dev->vqs[i].status_ring);
-	if (qdma_dev->vqs)
-		rte_free(qdma_dev->vqs);
+	rte_free(qdma_dev->vqs);
 	qdma_dev->vqs = NULL;
 	/* Reset QDMA device structure */