Skip to content

Commit 416c51e

Browse files
Eric Dumazetdavem330
authored andcommitted
netns: remove one sparse warning
net/core/net_namespace.c:227:18: warning: incorrect type in argument 1 (different address spaces) net/core/net_namespace.c:227:18: expected void const *<noident> net/core/net_namespace.c:227:18: got struct net_generic [noderef] <asn:4>*gen We can use rcu_access_pointer() here as read-side access to the pointer was removed at least one grace period ago. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent cc9c668 commit 416c51e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/net_namespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static void net_free(struct net *net)
224224
return;
225225
}
226226
#endif
227-
kfree(net->gen);
227+
kfree(rcu_access_pointer(net->gen));
228228
kmem_cache_free(net_cachep, net);
229229
}
230230

0 commit comments

Comments
 (0)