IB/iser: Fix device removal flow
authorRoi Dayan <roid@mellanox.com>
Wed, 8 May 2013 12:21:17 +0000 (12:21 +0000)
committerRoland Dreier <roland@purestorage.com>
Wed, 5 Jun 2013 00:03:11 +0000 (17:03 -0700)
commit5b61ff43a774b9843402fb280fec6d700e1fe583
treeee988e3658ccadb4284d02af11275a8621d6f802
parentd683b96b072dc4680fc74964eca77e6a23d1fa6e
IB/iser: Fix device removal flow

Change the code to destroy the "last opened" rdma_cm id after making
sure we released all other objects (QP, CQs, PD, etc) associated with
the IB device.

Since iser accesses the IB device using the rdma_cm id, we need to
free any objects that are related to the device that is associated
with the rdma_cm id prior to destroying that id.  When this isn't
done, the low level driver that created this device can be unloaded
before iser has a chance to free all the objects and a such a call may
invoke code segment which isn't valid any more and crash.

Cc: Sean Hefty <sean.hefty@intel.com
Signed-off-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/ulp/iser/iser_verbs.c