aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_semantics.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r--net/ipv4/fib_semantics.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index a8bdf7405433..e5b7182fa099 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -145,6 +145,12 @@ static void free_fib_info_rcu(struct rcu_head *head)
145{ 145{
146 struct fib_info *fi = container_of(head, struct fib_info, rcu); 146 struct fib_info *fi = container_of(head, struct fib_info, rcu);
147 147
148 change_nexthops(fi) {
149 if (nexthop_nh->nh_dev)
150 dev_put(nexthop_nh->nh_dev);
151 } endfor_nexthops(fi);
152
153 release_net(fi->fib_net);
148 if (fi->fib_metrics != (u32 *) dst_default_metrics) 154 if (fi->fib_metrics != (u32 *) dst_default_metrics)
149 kfree(fi->fib_metrics); 155 kfree(fi->fib_metrics);
150 kfree(fi); 156 kfree(fi);
@@ -156,13 +162,7 @@ void free_fib_info(struct fib_info *fi)
156 pr_warn("Freeing alive fib_info %p\n", fi); 162 pr_warn("Freeing alive fib_info %p\n", fi);
157 return; 163 return;
158 } 164 }
159 change_nexthops(fi) {
160 if (nexthop_nh->nh_dev)
161 dev_put(nexthop_nh->nh_dev);
162 nexthop_nh->nh_dev = NULL;
163 } endfor_nexthops(fi);
164 fib_info_cnt--; 165 fib_info_cnt--;
165 release_net(fi->fib_net);
166 call_rcu(&fi->rcu, free_fib_info_rcu); 166 call_rcu(&fi->rcu, free_fib_info_rcu);
167} 167}
168 168