diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index ddd4ba153..7a0991a1e 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -1979,13 +1979,20 @@ err_destroy_cq: static void srpt_destroy_ch_ib(struct srpt_rdma_ch *ch) { - WARN_ON(ch->thread); + TRACE_ENTRY(); + + if (ch->thread) { + kthread_stop(ch->thread); + ch->thread = NULL; + } while (ib_poll_cq(ch->cq, ARRAY_SIZE(ch->wc), ch->wc) > 0) ; ib_destroy_qp(ch->qp); ib_destroy_cq(ch->cq); + + TRACE_EXIT(); } /**