diff mbox series

[32/82] crypto/mvsam: remove unnecessary NULL checks

Message ID 20220124000518.319850-33-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/mvsam/rte_mrvl_pmd_ops.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Liron Himi Jan. 24, 2022, 7:44 a.m. UTC | #1
Reviewed-by: Liron Himi <lironh@marvell.com>

-----Original Message-----
From: Stephen Hemminger <stephen@networkplumber.org> 
Sent: Monday, 24 January 2022 02:04
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>; Michael Shamis <michaelsh@marvell.com>; Liron Himi <lironh@marvell.com>
Subject: [EXT] [PATCH 32/82] crypto/mvsam: remove unnecessary NULL checks

External Email

----------------------------------------------------------------------
Remove redundant NULL pointer checks before free functions found by nullfree.cocci

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

diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
index 3064b1f136fe..f828dc9db5f6 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
@@ -774,10 +774,8 @@ mrvl_crypto_pmd_sym_session_configure(__rte_unused struct rte_cryptodev *dev,
 	}
 
 	/* free the keys memory allocated for session creation */
-	if (mrvl_sess->sam_sess_params.cipher_key != NULL)
-		free(mrvl_sess->sam_sess_params.cipher_key);
-	if (mrvl_sess->sam_sess_params.auth_key != NULL)
-		free(mrvl_sess->sam_sess_params.auth_key);
+	free(mrvl_sess->sam_sess_params.cipher_key);
+	free(mrvl_sess->sam_sess_params.auth_key);
 
 	return 0;
 }
--
2.30.2
diff mbox series

Patch

diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
index 3064b1f136fe..f828dc9db5f6 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
@@ -774,10 +774,8 @@  mrvl_crypto_pmd_sym_session_configure(__rte_unused struct rte_cryptodev *dev,
 	}
 
 	/* free the keys memory allocated for session creation */
-	if (mrvl_sess->sam_sess_params.cipher_key != NULL)
-		free(mrvl_sess->sam_sess_params.cipher_key);
-	if (mrvl_sess->sam_sess_params.auth_key != NULL)
-		free(mrvl_sess->sam_sess_params.auth_key);
+	free(mrvl_sess->sam_sess_params.cipher_key);
+	free(mrvl_sess->sam_sess_params.auth_key);
 
 	return 0;
 }