From b0ca71f0a06573f6dbbf5922bca2e2cbd28c5497 Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Wed, 19 Apr 2017 23:06:07 +0000 Subject: [PATCH] Free lro_hash unconditionally, just like lro_mbuf_data a few lines later. Fix whitespace nit while here. --- sys/netinet/tcp_lro.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index f0bbb0d601c..b455fee7068 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -175,17 +175,15 @@ tcp_lro_free(struct lro_ctrl *lc) } /* free hash table */ - if (lc->lro_hash != NULL) { - free(lc->lro_hash, M_LRO); - lc->lro_hash = NULL; - } + free(lc->lro_hash, M_LRO); + lc->lro_hash = NULL; lc->lro_hashsz = 0; /* free mbuf array, if any */ for (x = 0; x != lc->lro_mbuf_count; x++) m_freem(lc->lro_mbuf_data[x].mb); lc->lro_mbuf_count = 0; - + /* free allocated memory, if any */ free(lc->lro_mbuf_data, M_LRO); lc->lro_mbuf_data = NULL;