b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Antonio Quartulli <a@unstable.cc>
To: Sven Eckelmann <sven@narfation.org>
Cc: 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 next] batman-adv: Free tp_meter ack skb when it was not consumed
Date: Tue, 21 Jun 2016 04:24:00 +0800	[thread overview]
Message-ID: <20160620202400.GE10666@prodigo> (raw)
In-Reply-To: <1634830.ALRq2khRYv@sven-edge>

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

On Mon, Jun 20, 2016 at 06:55:49PM +0200, Sven Eckelmann wrote:
> On Tuesday 21 June 2016 00:41:15 Antonio Quartulli wrote:
> [...]
> > However, how about changing the patch this way ?
> > 
> > --- a/net/batman-adv/tp_meter.c
> > +++ b/net/batman-adv/tp_meter.c
> > @@ -1206,7 +1206,7 @@ static int batadv_tp_send_ack(struct batadv_priv *bat_priv, const u8 *dst,
> >  
> >         /* send the ack */
> >         r = batadv_send_skb_to_orig(skb, orig_node, NULL);
> > -       if (r == -1)
> > +       if ((r == -1) || !dev_xmit_complete(res))
> >                 kfree_skb(skb);
> 
> Wouldn't this cause a double free when r != -1 and !dev_xmit_complete
> is true?  dev_queue_xmit would have consumed it anyway, right?
> 
> And did you mean r and not res?

Yes, I meant 'r'. 'res' was the result of a copy/paste error. Sorry.



-- 
Antonio Quartulli

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-06-20 20:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 16:14 [B.A.T.M.A.N.] [PATCH next] batman-adv: Avoid skb free for batadv_send_skb_to_orig < -1 Sven Eckelmann
2016-06-10 16:14 ` [B.A.T.M.A.N.] [PATCH next] batman-adv: Free tp_meter ack skb when it was not consumed Sven Eckelmann
2016-06-20 16:41   ` Antonio Quartulli
2016-06-20 16:55     ` Sven Eckelmann
2016-06-20 20:24       ` Antonio Quartulli [this message]
2016-06-20 17:28     ` Sven Eckelmann
2016-06-20  9:18 ` [B.A.T.M.A.N.] [PATCH next] batman-adv: Avoid skb free for batadv_send_skb_to_orig < -1 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=20160620202400.GE10666@prodigo \
    --to=a@unstable.cc \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=sven@narfation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).