aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Lüssing <linus.luessing@web.de>2013-07-26 21:24:44 -0400
committerAntonio Quartulli <ordex@autistici.org>2013-08-17 14:02:32 -0400
commit50fa3b31f4700deb1a860fa1a04016b889765323 (patch)
treeb830adeed468babf3057a0296e30efb182c03cf5 /net
parent0f7dd1aa8f959216f1faa71513b9d3c1a9065e5a (diff)
batman-adv: check return type of unicast packet preparations
batadv_unicast(_4addr)_prepare_skb might reallocate the skb's data. And if it tries to do so then this can potentially fail. We shouldn't continue working on this skb in such a case. Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Acked-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/unicast.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c
index 688a0419756b..857e1b8349ee 100644
--- a/net/batman-adv/unicast.c
+++ b/net/batman-adv/unicast.c
@@ -432,12 +432,16 @@ find_router:
432 432
433 switch (packet_type) { 433 switch (packet_type) {
434 case BATADV_UNICAST: 434 case BATADV_UNICAST:
435 batadv_unicast_prepare_skb(skb, orig_node); 435 if (!batadv_unicast_prepare_skb(skb, orig_node))
436 goto out;
437
436 header_len = sizeof(struct batadv_unicast_packet); 438 header_len = sizeof(struct batadv_unicast_packet);
437 break; 439 break;
438 case BATADV_UNICAST_4ADDR: 440 case BATADV_UNICAST_4ADDR:
439 batadv_unicast_4addr_prepare_skb(bat_priv, skb, orig_node, 441 if (!batadv_unicast_4addr_prepare_skb(bat_priv, skb, orig_node,
440 packet_subtype); 442 packet_subtype))
443 goto out;
444
441 header_len = sizeof(struct batadv_unicast_4addr_packet); 445 header_len = sizeof(struct batadv_unicast_4addr_packet);
442 break; 446 break;
443 default: 447 default: