diff options
author | Matt Mackall <mpm@selenic.com> | 2005-08-12 06:27:43 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-08-12 06:27:43 +0400 |
commit | 53fb95d3c14290fd6ee808b221e35493f096246f (patch) | |
tree | 146c31c79bbc66d8fde3afa5ae37a04b63041eba /net/core/netpoll.c | |
parent | 2652076507b662fc88ba16c27b59c7bdd9ccd956 (diff) | |
download | linux-53fb95d3c14290fd6ee808b221e35493f096246f.tar.xz |
[NETPOLL]: fix initialization/NAPI race
This fixes a race during initialization with the NAPI softirq
processing by using an RCU approach.
This race was discovered when refill_skbs() was added to
the setup code.
Signed-off-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/netpoll.c')
-rw-r--r-- | net/core/netpoll.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index c02a08da6d42..996787bca17f 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -732,6 +732,9 @@ int netpoll_setup(struct netpoll *np) /* last thing to do is link it to the net device structure */ ndev->npinfo = npinfo; + /* avoid racing with NAPI reading npinfo */ + synchronize_rcu(); + return 0; release: |