diff mbox series

[v2,37/83] crypto/scheduler: remove unnecessary NULL checks

Message ID 20220124174719.14417-38-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series remove unnecessary null checks | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Jan. 24, 2022, 5:46 p.m. UTC
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/scheduler/scheduler_pmd_ops.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Zhang, Roy Fan Jan. 25, 2022, 10:07 a.m. UTC | #1
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Monday, January 24, 2022 5:47 PM
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Zhang, Roy Fan
> <roy.fan.zhang@intel.com>
> Subject: [PATCH v2 37/83] crypto/scheduler: remove unnecessary NULL
> checks
> 
> Remove redundant NULL pointer checks before free functions
> found by nullfree.cocci
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
diff mbox series

Patch

diff --git a/drivers/crypto/scheduler/scheduler_pmd_ops.c b/drivers/crypto/scheduler/scheduler_pmd_ops.c
index f61640c9d646..f3a1bd626c6f 100644
--- a/drivers/crypto/scheduler/scheduler_pmd_ops.c
+++ b/drivers/crypto/scheduler/scheduler_pmd_ops.c
@@ -371,10 +371,8 @@  scheduler_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id)
 	if (!qp_ctx)
 		return 0;
 
-	if (qp_ctx->order_ring)
-		rte_ring_free(qp_ctx->order_ring);
-	if (qp_ctx->private_qp_ctx)
-		rte_free(qp_ctx->private_qp_ctx);
+	rte_ring_free(qp_ctx->order_ring);
+	rte_free(qp_ctx->private_qp_ctx);
 
 	rte_free(qp_ctx);
 	dev->data->queue_pairs[qp_id] = NULL;