diff options
Diffstat (limited to 'net/batman-adv/unicast.c')
-rw-r--r-- | net/batman-adv/unicast.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c index dc2e28bed844..ee41fef04b21 100644 --- a/net/batman-adv/unicast.c +++ b/net/batman-adv/unicast.c | |||
@@ -229,10 +229,12 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, | |||
229 | if (!bat_priv->primary_if) | 229 | if (!bat_priv->primary_if) |
230 | goto dropped; | 230 | goto dropped; |
231 | 231 | ||
232 | unicast_packet = (struct unicast_packet *) skb->data; | 232 | frag_skb = dev_alloc_skb(data_len - (data_len / 2) + ucf_hdr_len); |
233 | if (!frag_skb) | ||
234 | goto dropped; | ||
233 | 235 | ||
236 | unicast_packet = (struct unicast_packet *) skb->data; | ||
234 | memcpy(&tmp_uc, unicast_packet, uc_hdr_len); | 237 | memcpy(&tmp_uc, unicast_packet, uc_hdr_len); |
235 | frag_skb = dev_alloc_skb(data_len - (data_len / 2) + ucf_hdr_len); | ||
236 | skb_split(skb, frag_skb, data_len / 2); | 238 | skb_split(skb, frag_skb, data_len / 2); |
237 | 239 | ||
238 | if (my_skb_head_push(skb, ucf_hdr_len - uc_hdr_len) < 0 || | 240 | if (my_skb_head_push(skb, ucf_hdr_len - uc_hdr_len) < 0 || |