]> git.baikalelectronics.ru Git - kernel.git/commitdiff
netns: remove one sparse warning
authorEric Dumazet <edumazet@google.com>
Tue, 9 Sep 2014 15:24:53 +0000 (08:24 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Sep 2014 03:10:45 +0000 (20:10 -0700)
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>
net/core/net_namespace.c

index 7c6b51a58968613010576f3bd35a3cb6c527db08..7f155175bba83a0c8083008ece1a56e265174984 100644 (file)
@@ -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);
 }