diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/batman-adv/fragmentation.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c index f14e54a05691..022d18ab27a6 100644 --- a/net/batman-adv/fragmentation.c +++ b/net/batman-adv/fragmentation.c | |||
@@ -128,6 +128,7 @@ static bool batadv_frag_insert_packet(struct batadv_orig_node *orig_node, | |||
128 | { | 128 | { |
129 | struct batadv_frag_table_entry *chain; | 129 | struct batadv_frag_table_entry *chain; |
130 | struct batadv_frag_list_entry *frag_entry_new = NULL, *frag_entry_curr; | 130 | struct batadv_frag_list_entry *frag_entry_new = NULL, *frag_entry_curr; |
131 | struct batadv_frag_list_entry *frag_entry_last = NULL; | ||
131 | struct batadv_frag_packet *frag_packet; | 132 | struct batadv_frag_packet *frag_packet; |
132 | uint8_t bucket; | 133 | uint8_t bucket; |
133 | uint16_t seqno, hdr_size = sizeof(struct batadv_frag_packet); | 134 | uint16_t seqno, hdr_size = sizeof(struct batadv_frag_packet); |
@@ -180,11 +181,14 @@ static bool batadv_frag_insert_packet(struct batadv_orig_node *orig_node, | |||
180 | ret = true; | 181 | ret = true; |
181 | goto out; | 182 | goto out; |
182 | } | 183 | } |
184 | |||
185 | /* store current entry because it could be the last in list */ | ||
186 | frag_entry_last = frag_entry_curr; | ||
183 | } | 187 | } |
184 | 188 | ||
185 | /* Reached the end of the list, so insert after 'frag_entry_curr'. */ | 189 | /* Reached the end of the list, so insert after 'frag_entry_last'. */ |
186 | if (likely(frag_entry_curr)) { | 190 | if (likely(frag_entry_last)) { |
187 | hlist_add_after(&frag_entry_curr->list, &frag_entry_new->list); | 191 | hlist_add_after(&frag_entry_last->list, &frag_entry_new->list); |
188 | chain->size += skb->len - hdr_size; | 192 | chain->size += skb->len - hdr_size; |
189 | chain->timestamp = jiffies; | 193 | chain->timestamp = jiffies; |
190 | ret = true; | 194 | ret = true; |