Skip to content

Commit

Permalink
netns: remove one sparse warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Sep 10, 2014
1 parent cc9c668 commit 416c51e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/net_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ static void net_free(struct net *net)
return;
}
#endif
kfree(net->gen);
kfree(rcu_access_pointer(net->gen));
kmem_cache_free(net_cachep, net);
}

Expand Down

0 comments on commit 416c51e

Please sign in to comment.