From 1061f1cf439fbd1a32b3a7f1d9d08f954e2269e6 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 5 Jun 2011 09:57:35 +0000 Subject: [PATCH] ib_srpt: Fix a recently introduced leak in an error path git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3541 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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(); } /**