Skip to contentSkip to conversation

crypto/ipsec_mb: fix of qp NULL check

PATCH Applied Kai Ji 3 participants 3 messages Nov 1, 2022 – Nov 3, 2022 Crypto API

lore
Share & tools
lore

Kai Ji

author
#0 lore raw

PATCH 1/1 crypto/ipsec_mb: fix of qp NULL check

This patch fix the NULL pointer check when dereference qp and ring lookup.

Coverity issue: 381625

Fixes c75542ae4200 ("crypto/ipsec_mb: introduce IPsec_mb framework")
---
 drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/crypto/ipsec_mb/ipsec_mb_ops.c +3 -2
index bf18d692bd..7bb3e4d46c 100644
@@ -141,12 +141,13 @@ ipsec_mb_qp_release(struct rte_cryptodev *dev, uint16_t qp_id)
 	struct ipsec_mb_qp *qp = dev->data->queue_pairs[qp_id];
 	struct rte_ring *r = NULL;
 
-	if (qp != NULL)
+	if (!qp)
 		return 0;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		r = rte_ring_lookup(qp->name);
-		rte_ring_free(r);
+		if (r)
+			rte_ring_free(r);
 
 #if IMB_VERSION(1, 1, 0) > IMB_VERSION_NUM
 		if (qp->mb_mgr)
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 13 lines

-----Original Message-----
From: Ji, Kai <[email protected]>
Sent: Tuesday 1 November 2022 14:07
To: [email protected]
Cc: [email protected]; Ji, Kai <[email protected]>; [email protected]; De Lara Guarch, Pablo <[email protected]>; Ray Kinsella <[email protected]>; Power, Ciara <[email protected]>
Subject: [dpdk-dev v1] crypto/ipsec_mb: fix of qp NULL check

This patch fix the NULL pointer check when dereference qp and ring lookup.

Quoted 8 lines

Coverity issue: 381625

Fixes c75542ae4200 ("crypto/ipsec_mb: introduce IPsec_mb framework")
---
 drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Applied
#2 lore raw
Quoted 8 lines
Quoted 8 lines

Subject: [dpdk-dev v1] crypto/ipsec_mb: fix of qp NULL check

This patch fix the NULL pointer check when dereference qp and ring lookup.

Coverity issue: 381625

Fixes c75542ae4200 ("crypto/ipsec_mb: introduce IPsec_mb framework")
Quoted 6 lines
Quoted 4 lines
---
 drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

You should use devtools/check-git-log.sh

Applied to dpdk-next-crypto
Thanks.