test/cryptodev: remove unnecessary null check before free

Message ID 20230710202236.18078-1-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series test/cryptodev: remove unnecessary null check before free |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Stephen Hemminger July 10, 2023, 8:22 p.m. UTC
  Found by devtools/cocci/nullfree.cocci

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

Comments

Gowrishankar Muthukrishnan July 11, 2023, 4:20 a.m. UTC | #1
Acked-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
  
Akhil Goyal July 11, 2023, 8:51 a.m. UTC | #2
> Found by devtools/cocci/nullfree.cocci
> 
> Fixes: 2d970c663314 ("cryptodev: add asymmetric SM2 algorithm")
> Cc: gmuthukrishn@marvell.com
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
Applied to dpdk-next-crypto
Thanks.
  

Patch

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);