Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90792
b: refs/heads/master
c: 3661a91
h: refs/heads/master
v: v3
  • Loading branch information
Denis V. Lunev authored and David S. Miller committed Apr 16, 2008
1 parent 4722686 commit d415bc1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 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: 48115becf6ad9c0e700ff7c1792b7f2a288ef8fb
refs/heads/master: 3661a910836a509be65afc3c1e512d900e1280f9
1 change: 1 addition & 0 deletions trunk/include/net/fib_rules.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ static inline void fib_rule_get(struct fib_rule *rule)
static inline void fib_rule_put_rcu(struct rcu_head *head)
{
struct fib_rule *rule = container_of(head, struct fib_rule, rcu);
release_net(rule->fr_net);
kfree(rule);
}

Expand Down
5 changes: 3 additions & 2 deletions trunk/net/core/fib_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int fib_default_rule_add(struct fib_rules_ops *ops,
r->pref = pref;
r->table = table;
r->flags = flags;
r->fr_net = ops->fro_net;
r->fr_net = hold_net(ops->fro_net);

/* The lock is not required here, the list in unreacheable
* at the moment this function is called */
Expand Down Expand Up @@ -243,7 +243,7 @@ static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
err = -ENOMEM;
goto errout;
}
rule->fr_net = net;
rule->fr_net = hold_net(net);

if (tb[FRA_PRIORITY])
rule->pref = nla_get_u32(tb[FRA_PRIORITY]);
Expand Down Expand Up @@ -344,6 +344,7 @@ static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
return 0;

errout_free:
release_net(rule->fr_net);
kfree(rule);
errout:
rules_ops_put(ops);
Expand Down

0 comments on commit d415bc1

Please sign in to comment.