提交 d3ea5478 编写于 作者: L Linus Torvalds

rdma: fix buggy code that the compiler warns about

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: 6efaf10f ("IB/rdmavt: Avoid queuing work into a destroyed cq kthread worker")
Cc: Petr Mladek <pmladek@suse.com>
Cc: Doug Ledford <dledford@redhat.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 4d5b57e0
...@@ -532,7 +532,8 @@ void rvt_cq_exit(struct rvt_dev_info *rdi) ...@@ -532,7 +532,8 @@ void rvt_cq_exit(struct rvt_dev_info *rdi)
/* block future queuing from send_complete() */ /* block future queuing from send_complete() */
spin_lock_irq(&rdi->n_cqs_lock); spin_lock_irq(&rdi->n_cqs_lock);
if (!rdi->worker) { worker = rdi->worker;
if (!worker) {
spin_unlock_irq(&rdi->n_cqs_lock); spin_unlock_irq(&rdi->n_cqs_lock);
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册