diff mbox series

[29/82] crypto/ccp: remove unnecessary NULL checks

Message ID 20220124000518.319850-30-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, 12:04 a.m. UTC
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/crypto/ccp/ccp_dev.c     | 3 +--
 drivers/crypto/ccp/ccp_pmd_ops.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/crypto/ccp/ccp_dev.c b/drivers/crypto/ccp/ccp_dev.c
index 0eb1b0328ef0..424ead82c3aa 100644
--- a/drivers/crypto/ccp/ccp_dev.c
+++ b/drivers/crypto/ccp/ccp_dev.c
@@ -673,8 +673,7 @@  ccp_probe_device(int ccp_type, struct rte_pci_device *pci_dev)
 	CCP_LOG_ERR("CCP Device probe failed");
 	if (uio_fd >= 0)
 		close(uio_fd);
-	if (ccp_dev)
-		rte_free(ccp_dev);
+	rte_free(ccp_dev);
 	return -1;
 }
 
diff --git a/drivers/crypto/ccp/ccp_pmd_ops.c b/drivers/crypto/ccp/ccp_pmd_ops.c
index 0d615d311c9b..1b600e81ad5c 100644
--- a/drivers/crypto/ccp/ccp_pmd_ops.c
+++ b/drivers/crypto/ccp/ccp_pmd_ops.c
@@ -744,8 +744,7 @@  ccp_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 
 qp_setup_cleanup:
 	dev->data->queue_pairs[qp_id] = NULL;
-	if (qp)
-		rte_free(qp);
+	rte_free(qp);
 	return -1;
 }