diff options
author | Eric Dumazet <edumazet@google.com> | 2015-08-15 13:54:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-17 01:14:32 -0400 |
commit | 1e3136789975f03e461798149309034e5213c1b4 (patch) | |
tree | 82c553cbe65590071c28001f27e6325ad240bbb9 /net/ipv4/fib_semantics.c | |
parent | d52736e24fe2e927c26817256f8d1a3c8b5d51a0 (diff) |
ipv4: fix refcount leak in fib_check_nh()
fib_lookup() forces FIB_LOOKUP_NOREF flag, while fib_table_lookup()
does not.
This patch solves the typical message at reboot time or device
dismantle :
unregister_netdevice: waiting for eth0 to become free. Usage count = 4
Fixes: 3bfd847203c6 ("net: Use passed in table for nexthop lookups")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: David Ahern <dsa@cumulusnetworks.com>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r-- | net/ipv4/fib_semantics.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index b7f1d20a9615..c8025851dac7 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c | |||
@@ -708,7 +708,8 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi, | |||
708 | 708 | ||
709 | if (tbl) | 709 | if (tbl) |
710 | err = fib_table_lookup(tbl, &fl4, &res, | 710 | err = fib_table_lookup(tbl, &fl4, &res, |
711 | FIB_LOOKUP_IGNORE_LINKSTATE); | 711 | FIB_LOOKUP_IGNORE_LINKSTATE | |
712 | FIB_LOOKUP_NOREF); | ||
712 | else | 713 | else |
713 | err = fib_lookup(net, &fl4, &res, | 714 | err = fib_lookup(net, &fl4, &res, |
714 | FIB_LOOKUP_IGNORE_LINKSTATE); | 715 | FIB_LOOKUP_IGNORE_LINKSTATE); |