Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102728
b: refs/heads/master
c: 4caf86c
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Emelyanov authored and John W. Linville committed May 22, 2008
1 parent 1443277 commit 8292364
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5194ee82b4aafc35b32c96db11bdacea9bf548be
refs/heads/master: 4caf86c6928cfaca270327bc944f901c2e2a8f50
15 changes: 13 additions & 2 deletions trunk/net/mac80211/mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ struct mesh_table *mesh_table_grow(struct mesh_table *tbl)
{
struct mesh_table *newtbl;
struct hlist_head *oldhash;
struct hlist_node *p;
struct hlist_node *p, *q;
int err = 0;
int i;

Expand All @@ -373,13 +373,24 @@ struct mesh_table *mesh_table_grow(struct mesh_table *tbl)
oldhash = tbl->hash_buckets;
for (i = 0; i <= tbl->hash_mask; i++)
hlist_for_each(p, &oldhash[i])
tbl->copy_node(p, newtbl);
if (tbl->copy_node(p, newtbl) < 0)
goto errcopy;

endgrow:
if (err)
return NULL;
else
return newtbl;

errcopy:
for (i = 0; i <= newtbl->hash_mask; i++) {
hlist_for_each_safe(p, q, &newtbl->hash_buckets[i])
tbl->free_node(p, 0);
}
kfree(newtbl->hash_buckets);
kfree(newtbl->hashwlock);
kfree(newtbl);
return NULL;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/mac80211/mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ struct mesh_table {
__u32 hash_rnd; /* Used for hash generation */
atomic_t entries; /* Up to MAX_MESH_NEIGHBOURS */
void (*free_node) (struct hlist_node *p, bool free_leafs);
void (*copy_node) (struct hlist_node *p, struct mesh_table *newtbl);
int (*copy_node) (struct hlist_node *p, struct mesh_table *newtbl);
int size_order;
int mean_chain_len;
};
Expand Down
3 changes: 2 additions & 1 deletion trunk/net/mac80211/mesh_pathtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ static void mesh_path_node_free(struct hlist_node *p, bool free_leafs)
kfree(node);
}

static void mesh_path_node_copy(struct hlist_node *p, struct mesh_table *newtbl)
static int mesh_path_node_copy(struct hlist_node *p, struct mesh_table *newtbl)
{
struct mesh_path *mpath;
struct mpath_node *node, *new_node;
Expand All @@ -476,6 +476,7 @@ static void mesh_path_node_copy(struct hlist_node *p, struct mesh_table *newtbl)
hash_idx = mesh_table_hash(mpath->dst, mpath->dev, newtbl);
hlist_add_head(&new_node->list,
&newtbl->hash_buckets[hash_idx]);
return 0;
}

int mesh_pathtbl_init(void)
Expand Down

0 comments on commit 8292364

Please sign in to comment.