public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: "Martin Hundebøll" <martin@hundeboll.net>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCHv2 3/4] batman-adv: let tt_global_entry_has_orig() return the orig_entry or NULL instead of 1 or 0 only
Date: Mon, 09 Apr 2012 18:55:10 +0200	[thread overview]
Message-ID: <4F83146E.2080609@hundeboll.net> (raw)
In-Reply-To: <1333543332-26942-4-git-send-email-ordex@autistici.org>

Hi Antonio,

On 04/04/2012 02:42 PM, Antonio Quartulli wrote:

>   	rcu_read_lock();
>   	head =&entry->orig_list;
>   	hlist_for_each_entry_rcu(tmp_orig_entry, node, head, list) {
>   		if (tmp_orig_entry->orig_node == orig_node) {
> -			found = true;
> +			orig_entry = tmp_orig_entry;
>   			break;
>   		}
>   	}
>   	rcu_read_unlock();
> -	return found;
> +	return orig_entry;
>   }

I'm not that well into the tt code, but shouldn't there be some reference counting when handing pointers round like this?

-- 
Kind regards
Martin Hundebøll
Frederiks Allé 99A, 1.th
8000 Aarhus C

+45 61 65 54 61
martin@hundeboll.net

  reply	other threads:[~2012-04-09 16:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04 12:42 [B.A.T.M.A.N.] [PATCH 0/4] batman-adv: tt code fixes and temporary client detection Antonio Quartulli
2012-04-04 12:42 ` [B.A.T.M.A.N.] [PATCHv2 1/4] batman-adv: clear ADD+DEL (and viceversa) events in the same orig-interval Antonio Quartulli
2012-04-04 12:42 ` [B.A.T.M.A.N.] [PATCHv2 2/4] batman-adv: beautify tt_global_add() argument list Antonio Quartulli
2012-04-04 12:42 ` [B.A.T.M.A.N.] [PATCHv2 3/4] batman-adv: let tt_global_entry_has_orig() return the orig_entry or NULL instead of 1 or 0 only Antonio Quartulli
2012-04-09 16:55   ` Martin Hundebøll [this message]
2012-04-10 18:17     ` Antonio Quartulli
2012-04-04 12:42 ` [B.A.T.M.A.N.] [PATCHv2 4/4] batman-adv: enable nodes to detect not yet announced clients Antonio Quartulli
2012-04-06 10:13   ` 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=4F83146E.2080609@hundeboll.net \
    --to=martin@hundeboll.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox