Commit 88bc230d authored by Hariprasad S's avatar Hariprasad S Committed by Doug Ledford

RDMA/iw_cxgb4: stop ep timer on close failure

In c4iw_ep_disconnect(), if we start the ep timer to begin a close,
but send_halfclose() fails, we need to stop the timer and send a CLOSE
event up to the IWCM before releasing the resources. Otherwise, we can
crash when the ep timer fires if the ep is referencing a previous instance
of the device. This can happen as part of adapter reset/recovery, for
instance.
Signed-off-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 9dec900c
...@@ -3467,9 +3467,14 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp) ...@@ -3467,9 +3467,14 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp)
set_bit(EP_DISC_CLOSE, &ep->com.history); set_bit(EP_DISC_CLOSE, &ep->com.history);
ret = send_halfclose(ep, gfp); ret = send_halfclose(ep, gfp);
} }
if (ret) if (ret) {
if (!abrupt) {
stop_ep_timer(ep);
close_complete_upcall(ep, -EIO);
}
fatal = 1; fatal = 1;
} }
}
mutex_unlock(&ep->com.mutex); mutex_unlock(&ep->com.mutex);
if (fatal) if (fatal)
release_ep_resources(ep); release_ep_resources(ep);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment