From: Mike Baucom Date: Fri, 11 Sep 2020 01:55:44 +0000 (-0700) Subject: net/bnxt: free EM index on failure X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f01b6fceac77d9649aed46daf231b334f6a9dc94;p=dpdk.git net/bnxt: free EM index on failure When a Exact Match entry fails insertion, the allocated index needs to be pushed back to the allocation stack. This patch takes care of that. Signed-off-by: Mike Baucom Reviewed-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/tf_core/tf_em_internal.c b/drivers/net/bnxt/tf_core/tf_em_internal.c index 462d0fa769..c95515b1bf 100644 --- a/drivers/net/bnxt/tf_core/tf_em_internal.c +++ b/drivers/net/bnxt/tf_core/tf_em_internal.c @@ -175,8 +175,11 @@ tf_em_insert_int_entry(struct tf *tfp, &rptr_index, &rptr_entry, &num_of_entries); - if (rc) + if (rc) { + /* Free the allocated index before returning */ + stack_push(pool, index); return -1; + } PMD_DRV_LOG (DEBUG,