File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -319,6 +319,11 @@ static inline int check_net(const struct net *net)
319
319
#define net_drop_ns NULL
320
320
#endif
321
321
322
+ /* Returns true if the netns initialization is completed successfully */
323
+ static inline bool net_initialized (const struct net * net )
324
+ {
325
+ return READ_ONCE (net -> list .next );
326
+ }
322
327
323
328
static inline void netns_tracker_alloc (struct net * net ,
324
329
netns_tracker * tracker , gfp_t gfp )
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ static void ipmr_expire_process(struct timer_list *t);
116
116
117
117
static bool ipmr_can_free_table (struct net * net )
118
118
{
119
- return !check_net (net ) || !net -> ipv4 . mr_rules_ops ;
119
+ return !check_net (net ) || !net_initialized ( net ) ;
120
120
}
121
121
122
122
static struct mr_table * ipmr_mr_table_iter (struct net * net ,
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ static void ipmr_expire_process(struct timer_list *t);
103
103
104
104
static bool ip6mr_can_free_table (struct net * net )
105
105
{
106
- return !check_net (net ) || !net -> ipv6 . mr6_rules_ops ;
106
+ return !check_net (net ) || !net_initialized ( net ) ;
107
107
}
108
108
109
109
static struct mr_table * ip6mr_mr_table_iter (struct net * net ,
You can’t perform that action at this time.
0 commit comments