Skip to content

Commit

Permalink
efd: fix tailq entry leak in error path
Browse files Browse the repository at this point in the history
[ upstream commit c2402fc ]

In rte_efd_create() allocated memory for tailq entry, we should
free it when error happens, otherwise it will lead to memory leak.

Fixes: 56b6ef8 ("efd: new Elastic Flow Distributor library")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
  • Loading branch information
wyjwang authored and kevintraynor committed Nov 18, 2020
1 parent 9d7c950 commit 941bad7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/librte_efd/rte_efd.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,

error_unlock_exit:
rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);
rte_free(te);
rte_efd_free(table);

return NULL;
Expand Down

0 comments on commit 941bad7

Please sign in to comment.