aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSagi Grimberg <[email protected]>2017-03-08 22:00:52 +0200
committerDoug Ledford <[email protected]>2017-03-24 16:40:31 -0400
commit86f46aba8d1ac3ed0904542158a9b9cb9c7a143c (patch)
treee1eaa11ea1e04336059b0b9cba78389bf7e5f03f
parent871a8623d3b40221ad1103aff715dfee0aa4dacf (diff)
IB/core: Protect against self-requeue of a cq work item
We need to make sure that the cq work item does not run when we are destroying the cq. Unlike flush_work, cancel_work_sync protects against self-requeue of the work item (which we can do in ib_cq_poll_work). Signed-off-by: Sagi Grimberg <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Bart Van Assche <[email protected]>-- Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
-rw-r--r--drivers/infiniband/core/cq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/cq.c b/drivers/infiniband/core/cq.c
index e95510117a6d..2746d2eb3d52 100644
--- a/drivers/infiniband/core/cq.c
+++ b/drivers/infiniband/core/cq.c
@@ -196,7 +196,7 @@ void ib_free_cq(struct ib_cq *cq)
irq_poll_disable(&cq->iop);
break;
case IB_POLL_WORKQUEUE:
- flush_work(&cq->work);
+ cancel_work_sync(&cq->work);
break;
default:
WARN_ON_ONCE(1);