diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-05-07 17:55:59 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-22 03:47:45 +0200 |
commit | a3538b19a6d226f9d3d9b18865468370009dec55 (patch) | |
tree | d5a6d557d4fb9773817f9c657a8f22da53dd7d1c /net/mac80211/mesh.c | |
parent | mac80211: Do not report false error from mesh_path_add. (diff) | |
download | linux-a3538b19a6d226f9d3d9b18865468370009dec55.tar.xz linux-a3538b19a6d226f9d3d9b18865468370009dec55.zip |
mac80211: Merge error paths in mesh_table_grow().
This is the first (of two) clean ups after the fixes above.
The err variable is not even required after this cleaning.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mesh.c')
-rw-r--r-- | net/mac80211/mesh.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index ca81d0065eb8..cbce001f8f23 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -350,20 +350,15 @@ struct mesh_table *mesh_table_grow(struct mesh_table *tbl) struct mesh_table *newtbl; struct hlist_head *oldhash; struct hlist_node *p, *q; - int err = 0; int i; if (atomic_read(&tbl->entries) - < tbl->mean_chain_len * (tbl->hash_mask + 1)) { - err = -EPERM; + < tbl->mean_chain_len * (tbl->hash_mask + 1)) goto endgrow; - } newtbl = mesh_table_alloc(tbl->size_order + 1); - if (!newtbl) { - err = -ENOMEM; + if (!newtbl) goto endgrow; - } newtbl->free_node = tbl->free_node; newtbl->mean_chain_len = tbl->mean_chain_len; @@ -376,11 +371,7 @@ struct mesh_table *mesh_table_grow(struct mesh_table *tbl) if (tbl->copy_node(p, newtbl) < 0) goto errcopy; -endgrow: - if (err) - return NULL; - else - return newtbl; + return newtbl; errcopy: for (i = 0; i <= newtbl->hash_mask; i++) { @@ -390,6 +381,7 @@ errcopy: kfree(newtbl->hash_buckets); kfree(newtbl->hashwlock); kfree(newtbl); +endgrow: return NULL; } |