linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Buesch <mb@bu3sch.de>
To: Pavel Emelyanov <xemul@openvz.org>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org,
	Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: [PATCH 7/7][MAC80211]: Consolidate hash kfree-ing in mesh.c.
Date: Wed, 7 May 2008 18:03:10 +0200	[thread overview]
Message-ID: <200805071803.11291.mb@bu3sch.de> (raw)
In-Reply-To: <4821D157.90403@openvz.org>

On Wednesday 07 May 2008 17:57:11 Pavel Emelyanov wrote:
> There are already two places, that kfree the mesh_table and
> its buckets.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
> 
> ---
>  net/mac80211/mesh.c |   15 +++++++++------
>  1 files changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
> index f46fbdb..876ec18 100644
> --- a/net/mac80211/mesh.c
> +++ b/net/mac80211/mesh.c
> @@ -315,6 +315,13 @@ struct mesh_table *mesh_table_alloc(int size_order)
>  	return newtbl;
>  }
>  
> +static void __mesh_table_free(struct mesh_table *tbl)

Why is this __double_underscored?

> +{
> +	kfree(tbl->hash_buckets);
> +	kfree(tbl->hashwlock);
> +	kfree(tbl);
> +}
> +
>  void mesh_table_free(struct mesh_table *tbl, bool free_leafs)
>  {
>  	struct hlist_head *mesh_hash;
> @@ -330,9 +337,7 @@ void mesh_table_free(struct mesh_table *tbl, bool free_leafs)
>  		}
>  		spin_unlock(&tbl->hashwlock[i]);
>  	}
> -	kfree(tbl->hash_buckets);
> -	kfree(tbl->hashwlock);
> -	kfree(tbl);
> +	__mesh_table_free(tbl);
>  }
>  
>  static void ieee80211_mesh_path_timer(unsigned long data)
> @@ -378,9 +383,7 @@ errcopy:
>  		hlist_for_each_safe(p, q, &newtbl->hash_buckets[i])
>  			tbl->free_node(p, 0);
>  	}
> -	kfree(newtbl->hash_buckets);
> -	kfree(newtbl->hashwlock);
> -	kfree(newtbl);
> +	__mesh_table_free(tbl);
>  endgrow:
>  	return NULL;
>  }



-- 
Greetings Michael.

  reply	other threads:[~2008-05-07 16:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-07 15:57 [PATCH 7/7][MAC80211]: Consolidate hash kfree-ing in mesh.c Pavel Emelyanov
2008-05-07 16:03 ` Michael Buesch [this message]
2008-05-07 16:24   ` Pavel Emelyanov

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=200805071803.11291.mb@bu3sch.de \
    --to=mb@bu3sch.de \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=xemul@openvz.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).