batman-adv: Don't free unicast skb on failure

Message ID 1283639100-6506-1-git-send-email-sven.eckelmann@gmx.de (mailing list archive)
State Superseded, archived
Headers

Commit Message

Sven Eckelmann Sept. 4, 2010, 10:25 p.m. UTC
  The soft-interface transmission function expects that the unicast skb is
still available when a send failed. Otherwise we would try to free the
skb twice and create many different and hard to debug memory access
failures due to access on not (anymore) allocated memory.

Reported-by: Andreas Langer <an.langer@gmx.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
 unicast.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
  

Patch

diff --git a/unicast.c b/unicast.c
index 84b204b..796d9c1 100644
--- a/unicast.c
+++ b/unicast.c
@@ -264,6 +264,5 @@  int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv)
 unlock:
 	spin_unlock_irqrestore(&bat_priv->orig_hash_lock, flags);
 dropped:
-	kfree_skb(skb);
 	return 1;
 }