diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/cnic.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c index 9c2e7860b18e..3a7d3ce6db7b 100644 --- a/drivers/net/cnic.c +++ b/drivers/net/cnic.c | |||
@@ -59,6 +59,7 @@ MODULE_DESCRIPTION("Broadcom NetXtreme II CNIC Driver"); | |||
59 | MODULE_LICENSE("GPL"); | 59 | MODULE_LICENSE("GPL"); |
60 | MODULE_VERSION(CNIC_MODULE_VERSION); | 60 | MODULE_VERSION(CNIC_MODULE_VERSION); |
61 | 61 | ||
62 | /* cnic_dev_list modifications are protected by both rtnl and cnic_dev_lock */ | ||
62 | static LIST_HEAD(cnic_dev_list); | 63 | static LIST_HEAD(cnic_dev_list); |
63 | static LIST_HEAD(cnic_udev_list); | 64 | static LIST_HEAD(cnic_udev_list); |
64 | static DEFINE_RWLOCK(cnic_dev_lock); | 65 | static DEFINE_RWLOCK(cnic_dev_lock); |
@@ -445,14 +446,12 @@ int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops) | |||
445 | 446 | ||
446 | /* Prevent race conditions with netdev_event */ | 447 | /* Prevent race conditions with netdev_event */ |
447 | rtnl_lock(); | 448 | rtnl_lock(); |
448 | read_lock(&cnic_dev_lock); | ||
449 | list_for_each_entry(dev, &cnic_dev_list, list) { | 449 | list_for_each_entry(dev, &cnic_dev_list, list) { |
450 | struct cnic_local *cp = dev->cnic_priv; | 450 | struct cnic_local *cp = dev->cnic_priv; |
451 | 451 | ||
452 | if (!test_and_set_bit(ULP_F_INIT, &cp->ulp_flags[ulp_type])) | 452 | if (!test_and_set_bit(ULP_F_INIT, &cp->ulp_flags[ulp_type])) |
453 | ulp_ops->cnic_init(dev); | 453 | ulp_ops->cnic_init(dev); |
454 | } | 454 | } |
455 | read_unlock(&cnic_dev_lock); | ||
456 | rtnl_unlock(); | 455 | rtnl_unlock(); |
457 | 456 | ||
458 | return 0; | 457 | return 0; |