Skip to content

Commit

Permalink
Merge tag 'batadv-net-for-davem-20170125' of git://git.open-mesh.org/…
Browse files Browse the repository at this point in the history
…linux-merge

Simon Wunderlich says:

====================
Here is a batman-adv bugfix:

 - fix reference count handling on fragmentation error, by Sven Eckelmann
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
davem330 committed Jan 26, 2017
2 parents 529ec6a + 4ea33ef commit 214767f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions net/batman-adv/fragmentation.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ int batadv_frag_send_packet(struct sk_buff *skb,
primary_if = batadv_primary_if_get_selected(bat_priv);
if (!primary_if) {
ret = -EINVAL;
goto put_primary_if;
goto free_skb;
}

/* Create one header to be copied to all fragments */
Expand Down Expand Up @@ -502,7 +502,7 @@ int batadv_frag_send_packet(struct sk_buff *skb,
skb_fragment = batadv_frag_create(skb, &frag_header, mtu);
if (!skb_fragment) {
ret = -ENOMEM;
goto free_skb;
goto put_primary_if;
}

batadv_inc_counter(bat_priv, BATADV_CNT_FRAG_TX);
Expand All @@ -511,23 +511,23 @@ int batadv_frag_send_packet(struct sk_buff *skb,
ret = batadv_send_unicast_skb(skb_fragment, neigh_node);
if (ret != NET_XMIT_SUCCESS) {
ret = NET_XMIT_DROP;
goto free_skb;
goto put_primary_if;
}

frag_header.no++;

/* The initial check in this function should cover this case */
if (frag_header.no == BATADV_FRAG_MAX_FRAGMENTS - 1) {
ret = -EINVAL;
goto free_skb;
goto put_primary_if;
}
}

/* Make room for the fragment header. */
if (batadv_skb_head_push(skb, header_size) < 0 ||
pskb_expand_head(skb, header_size + ETH_HLEN, 0, GFP_ATOMIC) < 0) {
ret = -ENOMEM;
goto free_skb;
goto put_primary_if;
}

memcpy(skb->data, &frag_header, header_size);
Expand Down

0 comments on commit 214767f

Please sign in to comment.