[v2,3/7] lpm: remove unnecessary NULL checks
Checks
Commit Message
The functions rte_lpm_free() and rte_lpm6_free() already
handle NULL pointer case.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test/test_func_reentrancy.c | 3 +--
lib/lpm/rte_lpm.h | 1 +
lib/lpm/rte_lpm6.h | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
@@ -348,8 +348,7 @@ lpm_clean(unsigned int lcore_id)
int i;
lpm = rte_lpm_find_existing("fr_test_once");
- if (lpm != NULL)
- rte_lpm_free(lpm);
+ rte_lpm_free(lpm);
for (i = 0; i < MAX_LPM_ITER_TIMES; i++) {
snprintf(lpm_name, sizeof(lpm_name), "fr_test_%d_%d", lcore_id, i);
@@ -183,6 +183,7 @@ rte_lpm_find_existing(const char *name);
*
* @param lpm
* LPM object handle
+ * If NULL then, the function does nothing.
* @return
* None
*/
@@ -73,6 +73,7 @@ rte_lpm6_find_existing(const char *name);
*
* @param lpm
* LPM object handle
+ * If NULL then, the function does nothing.
* @return
* None
*/