Commit 3661a910836a509be65afc3c1e512d900e1280f9
Committed by
David S. Miller
1 parent
48115becf6
Exists in
master
and in
7 other branches
[NETNS]: Add netns refcnt debug to fib rules.
Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 2 changed files with 4 additions and 2 deletions Side-by-side Diff
include/net/fib_rules.h
net/core/fib_rules.c
... | ... | @@ -29,7 +29,7 @@ |
29 | 29 | r->pref = pref; |
30 | 30 | r->table = table; |
31 | 31 | r->flags = flags; |
32 | - r->fr_net = ops->fro_net; | |
32 | + r->fr_net = hold_net(ops->fro_net); | |
33 | 33 | |
34 | 34 | /* The lock is not required here, the list in unreacheable |
35 | 35 | * at the moment this function is called */ |
... | ... | @@ -243,7 +243,7 @@ |
243 | 243 | err = -ENOMEM; |
244 | 244 | goto errout; |
245 | 245 | } |
246 | - rule->fr_net = net; | |
246 | + rule->fr_net = hold_net(net); | |
247 | 247 | |
248 | 248 | if (tb[FRA_PRIORITY]) |
249 | 249 | rule->pref = nla_get_u32(tb[FRA_PRIORITY]); |
... | ... | @@ -344,6 +344,7 @@ |
344 | 344 | return 0; |
345 | 345 | |
346 | 346 | errout_free: |
347 | + release_net(rule->fr_net); | |
347 | 348 | kfree(rule); |
348 | 349 | errout: |
349 | 350 | rules_ops_put(ops); |