summaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorDavid Ahern2019-03-28 04:53:51 +0100
committerDavid S. Miller2019-03-29 18:48:03 +0100
commitdac7d0f27075ce54017a7efdd6ae0a55352a0f80 (patch)
tree1f2625e0a0afdf2efd4a150689a91610adcba873 /net/ipv6/route.c
parentipv6: Create init helper for fib6_nh (diff)
downloadkernel-qcow2-linux-dac7d0f27075ce54017a7efdd6ae0a55352a0f80.tar.gz
kernel-qcow2-linux-dac7d0f27075ce54017a7efdd6ae0a55352a0f80.tar.xz
kernel-qcow2-linux-dac7d0f27075ce54017a7efdd6ae0a55352a0f80.zip
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>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 8c5a998b28a1..5f453c79dd00 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -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)