aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/inet_frag.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/inet_frag.h')
-rw-r--r--include/net/inet_frag.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h
index 4182c9be8bb5..bfcbc0017950 100644
--- a/include/net/inet_frag.h
+++ b/include/net/inet_frag.h
@@ -141,14 +141,15 @@ static inline int sum_frag_mem_limit(struct netns_frags *nf)
141static inline void inet_frag_lru_move(struct inet_frag_queue *q) 141static inline void inet_frag_lru_move(struct inet_frag_queue *q)
142{ 142{
143 spin_lock(&q->net->lru_lock); 143 spin_lock(&q->net->lru_lock);
144 list_move_tail(&q->lru_list, &q->net->lru_list); 144 if (!list_empty(&q->lru_list))
145 list_move_tail(&q->lru_list, &q->net->lru_list);
145 spin_unlock(&q->net->lru_lock); 146 spin_unlock(&q->net->lru_lock);
146} 147}
147 148
148static inline void inet_frag_lru_del(struct inet_frag_queue *q) 149static inline void inet_frag_lru_del(struct inet_frag_queue *q)
149{ 150{
150 spin_lock(&q->net->lru_lock); 151 spin_lock(&q->net->lru_lock);
151 list_del(&q->lru_list); 152 list_del_init(&q->lru_list);
152 q->net->nqueues--; 153 q->net->nqueues--;
153 spin_unlock(&q->net->lru_lock); 154 spin_unlock(&q->net->lru_lock);
154} 155}