[PATCH] test/cryptodev: remove unnecessary null check before free

Stephen Hemminger stephen at networkplumber.org
Mon Jul 10 22:22:36 CEST 2023


Found by devtools/cocci/nullfree.cocci

Fixes: 2d970c663314 ("cryptodev: add asymmetric SM2 algorithm")
Cc: gmuthukrishn at marvell.com
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 app/test/test_cryptodev_asym.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 15a1f3d6385e..391d122f530d 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -2654,8 +2654,7 @@ _test_sm2_enc(bool rnd_secret)
 		}
 	}
 exit:
-	if (pbuf != NULL)
-		rte_free(pbuf);
+	rte_free(pbuf);
 
 	if (sess != NULL)
 		rte_cryptodev_asym_session_free(dev_id, sess);
-- 
2.39.2



More information about the dev mailing list