lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <55E5EED9.20201@cogentembedded.com>
Date:	Tue, 1 Sep 2015 21:30:49 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Ahmed Amamou <ahmed@...di.net>, netdev@...r.kernel.org
Cc:	William Dauchy <william@...di.net>,
	Kamel Haddadou <kamel@...di.net>
Subject: Re: [PATCH RFC v2 10/21] net: rbridge: add rbr_node management
 function

On 09/01/2015 06:43 PM, Ahmed Amamou wrote:

> rbr_node are used to save distant Rbridges information
> they are use by local Rbridge to take routing decision
> this patch add get/put/free/find/del  function to rbr_node to
> avoid freeing a rbr_node that is still in use for routing
>
> Signed-off-by: Ahmed Amamou <ahmed@...di.net>
> Signed-off-by: Kamel Haddadou <kamel@...di.net>
> Signed-off-by: William Dauchy <william@...di.net>
> ---
>   net/bridge/rbr.c         | 35 +++++++++++++++++++++++++++++++++++
>   net/bridge/rbr_private.h | 23 +++++++++++++++++++++++
>   2 files changed, 58 insertions(+)

[...]
> diff --git a/net/bridge/rbr_private.h b/net/bridge/rbr_private.h
> index 9166a8b..186e454 100644
> --- a/net/bridge/rbr_private.h
> +++ b/net/bridge/rbr_private.h
> @@ -44,7 +44,30 @@ struct rbr {
[...]
> +static inline void rbr_node_put(struct rbr_node *rbr_node)
> +{
> +	if (rbr_node) {
> +		if (unlikely(atomic_dec_and_test(&rbr_node->refs)))

    Could fold both 'if's into one and avoid {} altogether.

> +			rbr_node_free(rbr_node);
> +	}
> +}
> +

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ