From: Sagi Grimberg Date: Wed, 8 Mar 2017 20:00:52 +0000 (+0200) Subject: IB/core: Protect against self-requeue of a cq work item X-Git-Tag: v4.14-rc1~1237^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=86f46aba8d1ac3ed0904542158a9b9cb9c7a143c;p=platform%2Fkernel%2Flinux-rpi3.git 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 Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche -- Reviewed-by: Leon Romanovsky Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/core/cq.c b/drivers/infiniband/core/cq.c index e955101..2746d2e 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);