app/test: remove unnecessary null check before free
PATCH 1/2 app/test: remove unnecessary null check before free
No need to check for NULL pointer before calling these functions Found by cocci/nullfree.cocci.
Signed-off-by Stephen Hemminger <[email protected]>
--- app/test/test_cryptodev_asym.c | 3 +-- app/test/test_reassembly_perf.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
app/test/test_cryptodev_asym.c +1 -2
@@ -565,8 +565,7 @@ ut_teardown_asym(void)if (self->sess !=NULL )rte_cryptodev_asym_session_free (dev_id, self->sess); -if (self->op !=NULL ) -rte_crypto_op_free (self->op); +rte_crypto_op_free (self->op); self->sess =NULL ; self->op =NULL ; self->result_op =NULL ;
app/test/test_reassembly_perf.c +1 -2
@@ -81,8 +81,7 @@ reassembly_test_teardown(void)if (frag_tbl !=NULL )rte_ip_frag_table_destroy (frag_tbl); -if (pkt_pool !=NULL ) -rte_mempool_free (pkt_pool); +rte_mempool_free (pkt_pool); } static void
Signature · 1 line
2.39.2
PATCH 2/2 net/bnxt: remove unnecessary check for null before free
No need to check for null pointer before calling rte_free(). Found by cocci/nullfree.cocci script.
Signed-off-by Stephen Hemminger <[email protected]>
--- drivers/net/bnxt/bnxt_ethdev.c | 3 +-- drivers/net/bnxt/bnxt_vnic.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +1 -2
@@ -6002,8 +6002,7 @@ static void bnxt_free_ctx_mem_buf(struct bnxt_ctx_mem_buf_info *ctx)if (!ctx)return ; -if (ctx->va) -rte_free (ctx->va); +rte_free (ctx->va); ctx->va =NULL ; ctx->dma =RTE_BAD_IOVA ;
drivers/net/bnxt/bnxt_vnic.c +1 -2
@@ -847,8 +847,7 @@ bnxt_vnic_rss_hash_algo_update(struct bnxt *bp,int32_t bnxt_vnic_queue_db_deinit (struct bnxt *bp) { -if (bp->vnic_queue_db.rss_q_db !=NULL ) -rte_hash_free (bp->vnic_queue_db.rss_q_db); +rte_hash_free (bp->vnic_queue_db.rss_q_db);return 0 ; }
Signature · 1 line
2.39.2