summaryrefslogtreecommitdiff
path: root/net/batman-adv/bat_iv_ogm.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-04-06 14:37:50 -0700
committerDavid S. Miller <davem@davemloft.net>2017-04-06 14:37:50 -0700
commitbd414860440eebc8a7eb54be94c97e6ed09bb402 (patch)
treee059b250b46a8e8cbcb54eff50d6d10ffd68baa7 /net/batman-adv/bat_iv_ogm.c
parent54280168f3d9870e0d2b169b991189a09fc870b2 (diff)
parentab044f8e3eaf84c4cc95d7606fadfdfa006dc8ec (diff)
Merge tag 'batadv-next-for-davem-20170406' of git://git.open-mesh.org/linux-merge
Simon Wunderlich says: ==================== This feature/cleanup patchset includes the following patches: - bump version strings, by Simon Wunderlich - Code and Style cleanups, by Sven Eckelmann (5 patches) - Remove an unneccessary memset, by Tobias Klauser - DAT and BLA optimizations for various corner cases, by Andreas Pape (5 patches) - forward/rebroadcast packet restructuring, by Linus Luessing (2 patches) - ethtool cleanup and remove unncessary code, by Sven Eckelmann (4 patches) - use net_device_stats from net_device instead of private copy, by Tobias Klauser ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/batman-adv/bat_iv_ogm.c')
-rw-r--r--net/batman-adv/bat_iv_ogm.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 71343d0fec94..495ba7cdcb04 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -679,15 +679,11 @@ static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff,
{
struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
struct batadv_forw_packet *forw_packet_aggr;
+ struct sk_buff *skb;
unsigned char *skb_buff;
unsigned int skb_size;
atomic_t *queue_left = own_packet ? NULL : &bat_priv->batman_queue_left;
- forw_packet_aggr = batadv_forw_packet_alloc(if_incoming, if_outgoing,
- queue_left, bat_priv);
- if (!forw_packet_aggr)
- return;
-
if (atomic_read(&bat_priv->aggregated_ogms) &&
packet_len < BATADV_MAX_AGGREGATION_BYTES)
skb_size = BATADV_MAX_AGGREGATION_BYTES;
@@ -696,9 +692,14 @@ static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff,
skb_size += ETH_HLEN;
- forw_packet_aggr->skb = netdev_alloc_skb_ip_align(NULL, skb_size);
- if (!forw_packet_aggr->skb) {
- batadv_forw_packet_free(forw_packet_aggr, true);
+ skb = netdev_alloc_skb_ip_align(NULL, skb_size);
+ if (!skb)
+ return;
+
+ forw_packet_aggr = batadv_forw_packet_alloc(if_incoming, if_outgoing,
+ queue_left, bat_priv, skb);
+ if (!forw_packet_aggr) {
+ kfree_skb(skb);
return;
}