summaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-02-08 15:02:50 -0800
committerDavid S. Miller <davem@davemloft.net>2011-02-08 15:02:50 -0800
commit8d3bdbd55a7e2a3f2c148a4830aa26dd682b21c4 (patch)
treed32637a46d04190f1123c2e7ad1ba460f53b8ff9 /samples
parentb2df5a8446e135f7648736b8bec8179c88ce360d (diff)
downloadop-kernel-dev-8d3bdbd55a7e2a3f2c148a4830aa26dd682b21c4.zip
op-kernel-dev-8d3bdbd55a7e2a3f2c148a4830aa26dd682b21c4.tar.gz
net: Fix lockdep regression caused by initializing netdev queues too early.
In commit aa9421041128abb4d269ee1dc502ff65fb3b7d69 ("net: init ingress queue") we moved the allocation and lock initialization of the queues into alloc_netdev_mq() since register_netdevice() is way too late. The problem is that dev->type is not setup until the setup() callback is invoked by alloc_netdev_mq(), and the dev->type is what determines the lockdep class to use for the locks in the queues. Fix this by doing the queue allocation after the setup() callback runs. This is safe because the setup() callback is not allowed to make any state changes that need to be undone on error (memory allocations, etc.). It may, however, make state changes that are undone by free_netdev() (such as netif_napi_add(), which is done by the ipoib driver's setup routine). The previous code also leaked a reference to the &init_net namespace object on RX/TX queue allocation failures. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud