From: Antonio Quartulli <ordex@autistici.org>
To: The list for a Better Approach To Mobile Ad-hoc Networking
<b.a.t.m.a.n@lists.open-mesh.org>
Cc: "Martin Hundebøll" <martin@hundeboll.net>
Subject: Re: [B.A.T.M.A.N.] [PATCH 5/6] batman-adv: Save overheard and tx packets for decoding.
Date: Sat, 1 Dec 2012 12:07:12 +0100 [thread overview]
Message-ID: <20121201110712.GJ24115@ritirata.org> (raw)
In-Reply-To: <20121201110150.GI24115@ritirata.org>
[-- Attachment #1: Type: text/plain, Size: 1431 bytes --]
On Sat, Dec 01, 2012 at 12:01:50PM +0100, Antonio Quartulli wrote:
> Hi Martin,
>
> On Fri, Nov 30, 2012 at 04:08:34PM +0100, Martin Hundebøll wrote:
> > @@ -47,8 +48,9 @@ static void batadv_nc_start_timer(struct batadv_priv *bat_priv)
> > int batadv_nc_init(struct batadv_priv *bat_priv)
> > {
> > bat_priv->nc.timestamp_fwd_flush = jiffies;
> > + bat_priv->nc.timestamp_sniffed_purge = jiffies;
> >
> > - if (bat_priv->nc.coding_hash)
> > + if (bat_priv->nc.coding_hash || bat_priv->nc.decoding_hash)
> > return 0;
> >
> > bat_priv->nc.coding_hash = batadv_hash_new(128);
> > @@ -58,6 +60,13 @@ int batadv_nc_init(struct batadv_priv *bat_priv)
> > batadv_hash_set_lock_class(bat_priv->nc.coding_hash,
> > &batadv_nc_coding_hash_lock_class_key);
> >
> > + bat_priv->nc.decoding_hash = batadv_hash_new(128);
> > + if (!bat_priv->nc.decoding_hash)
> > + goto err;
>
> the label err brings the flow to a lonely "return -ENOMEM". However if you it
> the case above it means that you already allocated "bat_priv->nc.coding_hash"
> successfully. May you need another label so that you can free "coding_hash"
> and avoid memory leak?
Sorry, I'm wrong here. Returning -ENOMEM will make the caller function proceed
with the cleaning up. Therefore you can ignore this comment.
Cheers,
--
Antonio Quartulli
..each of us alone is worth nothing..
Ernesto "Che" Guevara
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-12-01 11:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-30 15:08 [B.A.T.M.A.N.] [PATCH 0/6] CATWOMAN: Network coding in batman-adv Martin Hundebøll
2012-11-30 15:08 ` [B.A.T.M.A.N.] [PATCH 1/6] batman-adv: Add the initial code for network coding Martin Hundebøll
2012-11-30 15:08 ` [B.A.T.M.A.N.] [PATCH 2/6] batman-adv: Detect coding nodes and remove these after timeout Martin Hundebøll
2012-11-30 15:39 ` Sven Eckelmann
2012-11-30 15:08 ` [B.A.T.M.A.N.] [PATCH 3/6] batman-adv: Buffer unicast packets before forward Martin Hundebøll
2012-12-01 2:03 ` Antonio Quartulli
2012-11-30 15:08 ` [B.A.T.M.A.N.] [PATCH 4/6] batman-adv: Code and transmit packets if possible Martin Hundebøll
2012-12-01 2:23 ` Antonio Quartulli
2012-11-30 15:08 ` [B.A.T.M.A.N.] [PATCH 5/6] batman-adv: Save overheard and tx packets for decoding Martin Hundebøll
2012-12-01 11:01 ` Antonio Quartulli
2012-12-01 11:07 ` Antonio Quartulli [this message]
2012-11-30 15:08 ` [B.A.T.M.A.N.] [PATCH 6/6] batman-adv: Receive coded packets and decode them Martin Hundebøll
2012-12-01 11:14 ` [B.A.T.M.A.N.] [PATCH 0/6] CATWOMAN: Network coding in batman-adv Antonio Quartulli
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=20121201110712.GJ24115@ritirata.org \
--to=ordex@autistici.org \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=martin@hundeboll.net \
/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