diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-05-07 11:55:59 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-21 21:47:45 -0400 |
commit | a3538b19a6d226f9d3d9b18865468370009dec55 (patch) | |
tree | d5a6d557d4fb9773817f9c657a8f22da53dd7d1c /net/mac80211/mesh.c | |
parent | 3282aea9ea5644a5b0161ad0fbd70fbf1099a470 (diff) |
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) | |||
350 | struct mesh_table *newtbl; | 350 | struct mesh_table *newtbl; |
351 | struct hlist_head *oldhash; | 351 | struct hlist_head *oldhash; |
352 | struct hlist_node *p, *q; | 352 | struct hlist_node *p, *q; |
353 | int err = 0; | ||
354 | int i; | 353 | int i; |
355 | 354 | ||
356 | if (atomic_read(&tbl->entries) | 355 | if (atomic_read(&tbl->entries) |
357 | < tbl->mean_chain_len * (tbl->hash_mask + 1)) { | 356 | < tbl->mean_chain_len * (tbl->hash_mask + 1)) |
358 | err = -EPERM; | ||
359 | goto endgrow; | 357 | goto endgrow; |
360 | } | ||
361 | 358 | ||
362 | newtbl = mesh_table_alloc(tbl->size_order + 1); | 359 | newtbl = mesh_table_alloc(tbl->size_order + 1); |
363 | if (!newtbl) { | 360 | if (!newtbl) |
364 | err = -ENOMEM; | ||
365 | goto endgrow; | 361 | goto endgrow; |
366 | } | ||
367 | 362 | ||
368 | newtbl->free_node = tbl->free_node; | 363 | newtbl->free_node = tbl->free_node; |
369 | newtbl->mean_chain_len = tbl->mean_chain_len; | 364 | newtbl->mean_chain_len = tbl->mean_chain_len; |
@@ -376,11 +371,7 @@ struct mesh_table *mesh_table_grow(struct mesh_table *tbl) | |||
376 | if (tbl->copy_node(p, newtbl) < 0) | 371 | if (tbl->copy_node(p, newtbl) < 0) |
377 | goto errcopy; | 372 | goto errcopy; |
378 | 373 | ||
379 | endgrow: | 374 | return newtbl; |
380 | if (err) | ||
381 | return NULL; | ||
382 | else | ||
383 | return newtbl; | ||
384 | 375 | ||
385 | errcopy: | 376 | errcopy: |
386 | for (i = 0; i <= newtbl->hash_mask; i++) { | 377 | for (i = 0; i <= newtbl->hash_mask; i++) { |
@@ -390,6 +381,7 @@ errcopy: | |||
390 | kfree(newtbl->hash_buckets); | 381 | kfree(newtbl->hash_buckets); |
391 | kfree(newtbl->hashwlock); | 382 | kfree(newtbl->hashwlock); |
392 | kfree(newtbl); | 383 | kfree(newtbl); |
384 | endgrow: | ||
393 | return NULL; | 385 | return NULL; |
394 | } | 386 | } |
395 | 387 | ||