]> git.baikalelectronics.ru Git - kernel.git/commit
net: set fib rule refcount after malloc
authorDavid Ahern <dsahern@gmail.com>
Thu, 13 Jul 2017 20:36:40 +0000 (13:36 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Jul 2017 20:43:54 +0000 (13:43 -0700)
commit02f4ff6358435f9402287a022800dd8231f32b3f
tree7b0aa95b996611976e9146156cafefd071016f26
parent58df6979d2aaba97ba1fb116fdf099c6709c6cc0
net: set fib rule refcount after malloc

The configure callback of fib_rules_ops can change the refcnt of a
fib rule. For instance, mlxsw takes a refcnt when adding the processing
of the rule to a work queue. Thus the rule refcnt can not be reset to
to 1 afterwards. Move the refcnt setting to after the allocation.

Fixes: 36b722743585 ("net: avoid one splat in fib_nl_delrule()")
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/fib_rules.c