diff options
author | Michael Chan <mchan@broadcom.com> | 2011-01-03 15:21:46 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-03 19:08:07 -0800 |
commit | 42bb8d56953a06de50941d6d3df89dc3023bb92d (patch) | |
tree | 29169d56608a6cf6ee73ddd40e19981c548e5cef /drivers/net/cnic.c | |
parent | 57045c996fb4e035f1d152b7e04315fc223352e9 (diff) | |
download | linux-42bb8d56953a06de50941d6d3df89dc3023bb92d.tar.bz2 |
cnic: Do not call bnx2i when bnx2i is calling cnic_unregister_driver()
We should call bnx2i to send the iSCSI netlink message earlier in
cnic_unregister_device(). By the time cnic_unregister_driver() is
called, bnx2i may have freed data structures used by the upcalls.
Update version to 2.2.12.
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cnic.c')
-rw-r--r-- | drivers/net/cnic.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c index 41957fa2d010..6dfa56440ac0 100644 --- a/drivers/net/cnic.c +++ b/drivers/net/cnic.c @@ -426,19 +426,6 @@ static int cnic_abort_prep(struct cnic_sock *csk) return 0; } -static void cnic_uio_stop(void) -{ - struct cnic_dev *dev; - - read_lock(&cnic_dev_lock); - list_for_each_entry(dev, &cnic_dev_list, list) { - struct cnic_local *cp = dev->cnic_priv; - - cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL); - } - read_unlock(&cnic_dev_lock); -} - int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops) { struct cnic_dev *dev; @@ -510,9 +497,6 @@ int cnic_unregister_driver(int ulp_type) } read_unlock(&cnic_dev_lock); - if (ulp_type == CNIC_ULP_ISCSI) - cnic_uio_stop(); - rcu_assign_pointer(cnic_ulp_tbl[ulp_type], NULL); mutex_unlock(&cnic_lock); @@ -596,6 +580,9 @@ static int cnic_unregister_device(struct cnic_dev *dev, int ulp_type) } mutex_unlock(&cnic_lock); + if (ulp_type == CNIC_ULP_ISCSI) + cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL); + synchronize_rcu(); while (test_bit(ULP_F_CALL_PENDING, &cp->ulp_flags[ulp_type]) && |