Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78777
b: refs/heads/master
c: fea86ad
h: refs/heads/master
i:
  78775: 2c5aac9
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Jan 28, 2008
1 parent 6681633 commit 8417f81
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 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: 187b5188a78694fa6608fa1252d5197a7b3ab076
refs/heads/master: fea86ad8123df0d49188cbc1dd2f48da6ae49d65
28 changes: 11 additions & 17 deletions trunk/net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,8 +980,7 @@ static struct node *trie_rebalance(struct trie *t, struct tnode *tn)

/* only used from updater-side */

static struct list_head *
fib_insert_node(struct trie *t, int *err, u32 key, int plen)
static struct list_head *fib_insert_node(struct trie *t, u32 key, int plen)
{
int pos, newpos;
struct tnode *tp = NULL, *tn = NULL;
Expand Down Expand Up @@ -1043,10 +1042,8 @@ fib_insert_node(struct trie *t, int *err, u32 key, int plen)

li = leaf_info_new(plen);

if (!li) {
*err = -ENOMEM;
goto done;
}
if (!li)
return NULL;

fa_head = &li->falh;
insert_leaf_info(&l->list, li);
Expand All @@ -1055,18 +1052,15 @@ fib_insert_node(struct trie *t, int *err, u32 key, int plen)
t->size++;
l = leaf_new();

if (!l) {
*err = -ENOMEM;
goto done;
}
if (!l)
return NULL;

l->key = key;
li = leaf_info_new(plen);

if (!li) {
tnode_free((struct tnode *) l);
*err = -ENOMEM;
goto done;
return NULL;
}

fa_head = &li->falh;
Expand Down Expand Up @@ -1102,8 +1096,7 @@ fib_insert_node(struct trie *t, int *err, u32 key, int plen)
if (!tn) {
free_leaf_info(li);
tnode_free((struct tnode *) l);
*err = -ENOMEM;
goto done;
return NULL;
}

node_set_parent((struct node *)tn, tp);
Expand Down Expand Up @@ -1262,10 +1255,11 @@ static int fn_trie_insert(struct fib_table *tb, struct fib_config *cfg)
*/

if (!fa_head) {
err = 0;
fa_head = fib_insert_node(t, &err, key, plen);
if (err)
fa_head = fib_insert_node(t, key, plen);
if (unlikely(!fa_head)) {
err = -ENOMEM;
goto out_free_new_fa;
}
}

list_add_tail_rcu(&new_fa->fa_list,
Expand Down

0 comments on commit 8417f81

Please sign in to comment.