All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell Senior <russell@personaltelco.net>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCH maint 2/2] batman-adv: free skb on TVLV parsing success
Date: Tue, 11 Feb 2014 09:13:22 -0800	[thread overview]
Message-ID: <86eh398te5.fsf@coulee.tdb.com> (raw)
In-Reply-To: <1392134707-2318-2-git-send-email-antonio@meshcoding.com> (Antonio Quartulli's message of "Tue\, 11 Feb 2014 17\:05\:07 +0100")


From: Antonio Quartulli <antonio@open-mesh.com>
When the TVLV parsing routine succeed the skb is left
untouched thus leading to a memory leak.

Fix this by consuming the skb in case of success.

Introduced by 0b6aa0d43767889eeda43a132cf5e73df4e63bf2
("batman-adv: tvlv - basic infrastructure")

Reported-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Tested-by: Russell Senior <russell@personaltelco.net>
---
 routing.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/routing.c b/routing.c
index f7579d0..71bf698 100644
--- a/routing.c
+++ b/routing.c
@@ -1063,6 +1063,8 @@ int batadv_recv_unicast_tvlv(struct sk_buff *skb,
 
 	if (ret != NET_RX_SUCCESS)
 		ret = batadv_route_unicast_packet(skb, recv_if);
+	else
+		consume_skb(skb);
 
 	return ret;
 }
-- 
1.8.5.3




-- 
Russell Senior, President
russell@personaltelco.net

  reply	other threads:[~2014-02-11 17:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11 16:05 [B.A.T.M.A.N.] [PATCH maint 1/2] batman-adv: fix TT CRC computation by ensuring byte order Antonio Quartulli
2014-02-11 16:05 ` [B.A.T.M.A.N.] [PATCH maint 2/2] batman-adv: free skb on TVLV parsing success Antonio Quartulli
2014-02-11 17:13   ` Russell Senior [this message]
2014-02-15  0:36   ` Marek Lindner
2014-02-11 16:56 ` [B.A.T.M.A.N.] [PATCH maint 1/2] batman-adv: fix TT CRC computation by ensuring byte order Antonio Quartulli
2014-02-11 17:31 ` Russell Senior
2014-02-15  0:29 ` Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86eh398te5.fsf@coulee.tdb.com \
    --to=russell@personaltelco.net \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.