diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-15 15:18:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-15 15:18:42 -0500 |
commit | d3ea547853852481dc5eba6d4cb13adab1564d0b (patch) | |
tree | 01d093ed7c8e6976b6c4150a97c0a02a41b2ff33 | |
parent | 4d5b57e05a67c3cfd8e2b2a64ca356245a15b1c6 (diff) |
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: 6efaf10f163d ("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: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/infiniband/sw/rdmavt/cq.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) | |||
532 | 532 | ||
533 | /* block future queuing from send_complete() */ | 533 | /* block future queuing from send_complete() */ |
534 | spin_lock_irq(&rdi->n_cqs_lock); | 534 | spin_lock_irq(&rdi->n_cqs_lock); |
535 | if (!rdi->worker) { | 535 | worker = rdi->worker; |
536 | if (!worker) { | ||
536 | spin_unlock_irq(&rdi->n_cqs_lock); | 537 | spin_unlock_irq(&rdi->n_cqs_lock); |
537 | return; | 538 | return; |
538 | } | 539 | } |