aboutsummaryrefslogtreecommitdiffstats
path: root/lib/librte_lpm
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-12-05 11:42:44 +0100
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-12-05 11:49:52 +0100
commitc300e3551a11a249b600463891a19a6792f42901 (patch)
tree0ec046063bf0cd783e9a7ccbb4f54baadccf1213 /lib/librte_lpm
parent893ab58d98e090c1631f4e2dd43069eeb58e78dc (diff)
Imported Upstream version 16.07.2
Change-Id: I76bc313e0942233ce259612069ded302dd6c87bb Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'lib/librte_lpm')
-rw-r--r--lib/librte_lpm/rte_lpm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c
index 6f65d1c2..e1b5d94a 100644
--- a/lib/librte_lpm/rte_lpm.c
+++ b/lib/librte_lpm/rte_lpm.c
@@ -321,6 +321,7 @@ rte_lpm_create_v1604(const char *name, int socket_id,
if (lpm->tbl8 == NULL) {
RTE_LOG(ERR, LPM, "LPM tbl8 memory allocation failed\n");
+ rte_free(lpm->rules_tbl);
rte_free(lpm);
lpm = NULL;
rte_free(te);
@@ -402,6 +403,7 @@ rte_lpm_free_v1604(struct rte_lpm *lpm)
rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);
+ rte_free(lpm->tbl8);
rte_free(lpm->rules_tbl);
rte_free(lpm);
rte_free(te);
@@ -1533,7 +1535,7 @@ tbl8_recycle_check_v20(struct rte_lpm_tbl_entry_v20 *tbl8,
* and if so check the rest of the entries to verify that they
* are all of this depth.
*/
- if (tbl8[tbl8_group_start].depth < MAX_DEPTH_TBL24) {
+ if (tbl8[tbl8_group_start].depth <= MAX_DEPTH_TBL24) {
for (i = (tbl8_group_start + 1); i < tbl8_group_end;
i++) {
@@ -1580,7 +1582,7 @@ tbl8_recycle_check_v1604(struct rte_lpm_tbl_entry *tbl8,
* and if so check the rest of the entries to verify that they
* are all of this depth.
*/
- if (tbl8[tbl8_group_start].depth < MAX_DEPTH_TBL24) {
+ if (tbl8[tbl8_group_start].depth <= MAX_DEPTH_TBL24) {
for (i = (tbl8_group_start + 1); i < tbl8_group_end;
i++) {