No need to check for NULL before calling rte_free
Found by devtools/cocci/nullfree.cocci

Signed-off-by: Stephen Hemminger <[email protected]>
---
 drivers/crypto/cnxk/cn20k_tls.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/crypto/cnxk/cn20k_tls.c b/drivers/crypto/cnxk/cn20k_tls.c
index ac6f6d9c4b..62bb71f035 100644
--- a/drivers/crypto/cnxk/cn20k_tls.c
+++ b/drivers/crypto/cnxk/cn20k_tls.c
@@ -799,8 +799,7 @@ cn20k_tls_write_sa_create(struct roc_cpt *roc_cpt, struct 
roc_cpt_lf *lf,
 
        rte_atomic_thread_fence(rte_memory_order_seq_cst);
 
-       if (tls->write_sa != NULL)
-               rte_free(tls->write_sa);
+       rte_free(tls->write_sa);
        tls->write_sa = write_sa;
 sa_dptr_free:
        plt_free(sa_dptr);
-- 
2.53.0

Reply via email to