ipv6: Create cleanup helper for fib6_nh

Move the fib6_nh cleanup code to a new helper, fib6_nh_release.

Signed-off-by: David Ahern <dsahern@gmail.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David Ahern
2019-03-27 20:53:51 -07:00
committed by David S. Miller
parent 83c4425159
commit dac7d0f270
3 changed files with 10 additions and 4 deletions

View File

@@ -3025,6 +3025,14 @@ out:
return err;
}
void fib6_nh_release(struct fib6_nh *fib6_nh)
{
lwtstate_put(fib6_nh->nh_lwtstate);
if (fib6_nh->nh_dev)
dev_put(fib6_nh->nh_dev);
}
static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg,
gfp_t gfp_flags,
struct netlink_ext_ack *extack)