Commit b1f9c67
xfrm: policy: fix sparse warnings in xfrm_policy_{init,fini}
In xfrm_policy_init:
add rcu_assign_pointer to fix warning:
net/xfrm/xfrm_policy.c:4238:29: warning: incorrect type in assignment (different address spaces)
net/xfrm/xfrm_policy.c:4238:29: expected struct hlist_head [noderef] __rcu *table
net/xfrm/xfrm_policy.c:4238:29: got struct hlist_head *
add rcu_dereference_protected to silence warning:
net/xfrm/xfrm_policy.c:4265:36: warning: incorrect type in argument 1 (different address spaces)
net/xfrm/xfrm_policy.c:4265:36: expected struct hlist_head *n
net/xfrm/xfrm_policy.c:4265:36: got struct hlist_head [noderef] __rcu *table
The netns is being created, no concurrent access is possible yet.
In xfrm_policy_fini, net is going away, there shouldn't be any
concurrent changes to the hashtables, so we can use
rcu_dereference_protected to silence warnings:
net/xfrm/xfrm_policy.c:4291:17: warning: incorrect type in argument 1 (different address spaces)
net/xfrm/xfrm_policy.c:4291:17: expected struct hlist_head const *h
net/xfrm/xfrm_policy.c:4291:17: got struct hlist_head [noderef] __rcu *table
net/xfrm/xfrm_policy.c:4292:36: warning: incorrect type in argument 1 (different address spaces)
net/xfrm/xfrm_policy.c:4292:36: expected struct hlist_head *n
net/xfrm/xfrm_policy.c:4292:36: got struct hlist_head [noderef] __rcu *table
Signed-off-by: Sabrina Dubroca <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Signed-off-by: Steffen Klassert <[email protected]>1 parent 05b8673 commit b1f9c67
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4242 | 4242 | | |
4243 | 4243 | | |
4244 | 4244 | | |
4245 | | - | |
| 4245 | + | |
4246 | 4246 | | |
4247 | 4247 | | |
4248 | 4248 | | |
| |||
4269 | 4269 | | |
4270 | 4270 | | |
4271 | 4271 | | |
4272 | | - | |
| 4272 | + | |
4273 | 4273 | | |
4274 | 4274 | | |
4275 | 4275 | | |
| |||
4295 | 4295 | | |
4296 | 4296 | | |
4297 | 4297 | | |
4298 | | - | |
4299 | | - | |
| 4298 | + | |
| 4299 | + | |
4300 | 4300 | | |
4301 | 4301 | | |
4302 | 4302 | | |
| |||
0 commit comments