lib: update documentation of some *_free functions
[dpdk.git] / lib / hash / rte_thash.c
index 6945a0a..6847e36 100644 (file)
@@ -28,7 +28,7 @@ EAL_REGISTER_TAILQ(rte_thash_tailq)
 
 /**
  * Table of some irreducible polinomials over GF(2).
- * For lfsr they are reperesented in BE bit order, and
+ * For lfsr they are represented in BE bit order, and
  * x^0 is masked out.
  * For example, poly x^5 + x^2 + 1 will be represented
  * as (101001b & 11111b) = 01001b = 0x9
@@ -468,10 +468,10 @@ insert_before(struct rte_thash_ctx *ctx,
                        return ret;
                }
        } else if ((next_ent != NULL) && (end > next_ent->offset)) {
-               rte_free(ent);
                RTE_LOG(ERR, HASH,
                        "Can't add helper %s due to conflict with existing"
                        " helper %s\n", ent->name, next_ent->name);
+               rte_free(ent);
                return -ENOSPC;
        }
        attach_lfsr(ent, cur_ent->lfsr);
@@ -517,10 +517,10 @@ insert_after(struct rte_thash_ctx *ctx,
        int ret;
 
        if ((next_ent != NULL) && (end > next_ent->offset)) {
-               rte_free(ent);
                RTE_LOG(ERR, HASH,
                        "Can't add helper %s due to conflict with existing"
                        " helper %s\n", ent->name, next_ent->name);
+               rte_free(ent);
                return -EEXIST;
        }