* [PATCH net-next] netns: remove one sparse warning
@ 2014-09-09 15:24 Eric Dumazet
2014-09-10 3:15 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2014-09-09 15:24 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
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>
---
net/core/net_namespace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 7c6b51a58968..7f155175bba8 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -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);
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] netns: remove one sparse warning
2014-09-09 15:24 [PATCH net-next] netns: remove one sparse warning Eric Dumazet
@ 2014-09-10 3:15 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-09-10 3:15 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 09 Sep 2014 08:24:53 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> 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>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-10 3:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-09 15:24 [PATCH net-next] netns: remove one sparse warning Eric Dumazet
2014-09-10 3:15 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).