|
@@ -157,9 +157,12 @@ static void rt_fibinfo_free(struct rtable __rcu **rtp)
|
|
|
|
|
|
|
|
static void free_nh_exceptions(struct fib_nh *nh)
|
|
static void free_nh_exceptions(struct fib_nh *nh)
|
|
|
{
|
|
{
|
|
|
- struct fnhe_hash_bucket *hash = nh->nh_exceptions;
|
|
|
|
|
|
|
+ struct fnhe_hash_bucket *hash;
|
|
|
int i;
|
|
int i;
|
|
|
|
|
|
|
|
|
|
+ hash = rcu_dereference_protected(nh->nh_exceptions, 1);
|
|
|
|
|
+ if (!hash)
|
|
|
|
|
+ return;
|
|
|
for (i = 0; i < FNHE_HASH_SIZE; i++) {
|
|
for (i = 0; i < FNHE_HASH_SIZE; i++) {
|
|
|
struct fib_nh_exception *fnhe;
|
|
struct fib_nh_exception *fnhe;
|
|
|
|
|
|
|
@@ -205,8 +208,7 @@ static void free_fib_info_rcu(struct rcu_head *head)
|
|
|
change_nexthops(fi) {
|
|
change_nexthops(fi) {
|
|
|
if (nexthop_nh->nh_dev)
|
|
if (nexthop_nh->nh_dev)
|
|
|
dev_put(nexthop_nh->nh_dev);
|
|
dev_put(nexthop_nh->nh_dev);
|
|
|
- if (nexthop_nh->nh_exceptions)
|
|
|
|
|
- free_nh_exceptions(nexthop_nh);
|
|
|
|
|
|
|
+ free_nh_exceptions(nexthop_nh);
|
|
|
rt_fibinfo_free_cpus(nexthop_nh->nh_pcpu_rth_output);
|
|
rt_fibinfo_free_cpus(nexthop_nh->nh_pcpu_rth_output);
|
|
|
rt_fibinfo_free(&nexthop_nh->nh_rth_input);
|
|
rt_fibinfo_free(&nexthop_nh->nh_rth_input);
|
|
|
} endfor_nexthops(fi);
|
|
} endfor_nexthops(fi);
|