提交 a3538b19 编写于 作者: P Pavel Emelyanov 提交者: John W. Linville

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: NPavel Emelyanov <xemul@openvz.org>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 3282aea9
...@@ -350,20 +350,15 @@ struct mesh_table *mesh_table_grow(struct mesh_table *tbl) ...@@ -350,20 +350,15 @@ struct mesh_table *mesh_table_grow(struct mesh_table *tbl)
struct mesh_table *newtbl; struct mesh_table *newtbl;
struct hlist_head *oldhash; struct hlist_head *oldhash;
struct hlist_node *p, *q; struct hlist_node *p, *q;
int err = 0;
int i; int i;
if (atomic_read(&tbl->entries) if (atomic_read(&tbl->entries)
< tbl->mean_chain_len * (tbl->hash_mask + 1)) { < tbl->mean_chain_len * (tbl->hash_mask + 1))
err = -EPERM;
goto endgrow; goto endgrow;
}
newtbl = mesh_table_alloc(tbl->size_order + 1); newtbl = mesh_table_alloc(tbl->size_order + 1);
if (!newtbl) { if (!newtbl)
err = -ENOMEM;
goto endgrow; goto endgrow;
}
newtbl->free_node = tbl->free_node; newtbl->free_node = tbl->free_node;
newtbl->mean_chain_len = tbl->mean_chain_len; newtbl->mean_chain_len = tbl->mean_chain_len;
...@@ -376,10 +371,6 @@ struct mesh_table *mesh_table_grow(struct mesh_table *tbl) ...@@ -376,10 +371,6 @@ struct mesh_table *mesh_table_grow(struct mesh_table *tbl)
if (tbl->copy_node(p, newtbl) < 0) if (tbl->copy_node(p, newtbl) < 0)
goto errcopy; goto errcopy;
endgrow:
if (err)
return NULL;
else
return newtbl; return newtbl;
errcopy: errcopy:
...@@ -390,6 +381,7 @@ struct mesh_table *mesh_table_grow(struct mesh_table *tbl) ...@@ -390,6 +381,7 @@ struct mesh_table *mesh_table_grow(struct mesh_table *tbl)
kfree(newtbl->hash_buckets); kfree(newtbl->hash_buckets);
kfree(newtbl->hashwlock); kfree(newtbl->hashwlock);
kfree(newtbl); kfree(newtbl);
endgrow:
return NULL; return NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册