From d3ea547853852481dc5eba6d4cb13adab1564d0b Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 15 Dec 2016 12:18:42 -0800 Subject: [PATCH] rdma: fix buggy code that the compiler warns about MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Get rid of this warning: drivers/infiniband/sw/rdmavt/cq.c: In function ‘rvt_cq_exit’: drivers/infiniband/sw/rdmavt/cq.c:542:2: warning: ‘worker’ may be used uninitialized in this function [-Wmaybe-uninitialized] kthread_destroy_worker(worker); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ by fixing the function to actually work. Fixes: 6efaf10f163d ("IB/rdmavt: Avoid queuing work into a destroyed cq kthread worker") Cc: Petr Mladek Cc: Doug Ledford Signed-off-by: Linus Torvalds --- drivers/infiniband/sw/rdmavt/cq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rdmavt/cq.c b/drivers/infiniband/sw/rdmavt/cq.c index 4d0b6992e847..7aa7a4e312f1 100644 --- a/drivers/infiniband/sw/rdmavt/cq.c +++ b/drivers/infiniband/sw/rdmavt/cq.c @@ -532,7 +532,8 @@ void rvt_cq_exit(struct rvt_dev_info *rdi) /* block future queuing from send_complete() */ spin_lock_irq(&rdi->n_cqs_lock); - if (!rdi->worker) { + worker = rdi->worker; + if (!worker) { spin_unlock_irq(&rdi->n_cqs_lock); return; } -- 2.20.1