RDMA/iwcm: iw_cm_id destruction race fixes
authorSteve Wise <swise@opengridcomputing.com>
Thu, 15 Feb 2007 14:09:36 +0000 (08:09 -0600)
committerRoland Dreier <rolandd@cisco.com>
Fri, 16 Feb 2007 21:57:35 +0000 (13:57 -0800)
commitebb90986e183296086b5d6678a838f125d743982
tree68cfbbd4bf32feda721cf34f220bcd9d84c75214
parent6bbcea0d42209ab5f0fae213050ad042c499ad8b
RDMA/iwcm: iw_cm_id destruction race fixes

iwcm iw_cm_id destruction race condition fixes:

- iwcm_deref_id() always wakes up if there's another reference.
- clean up race condition in cm_work_handler().
- create static void free_cm_id() which deallocs the work entries and then
  kfrees the cm_id memory.  This reduces code replication.
- rem_ref() if this is the last reference -and- the IWCM owns freeing the
  cm_id, then free it.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
Acked-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/core/iwcm.c