]> git.baikalelectronics.ru Git - kernel.git/commitdiff
nvme-rdma: cancel async events before freeing event struct
authorDavid Milburn <dmilburn@redhat.com>
Wed, 2 Sep 2020 22:42:52 +0000 (17:42 -0500)
committerChristoph Hellwig <hch@lst.de>
Tue, 8 Sep 2020 17:46:29 +0000 (19:46 +0200)
Cancel async event work in case async event has been queued up, and
nvme_rdma_submit_async_event() runs after event has been freed.

Signed-off-by: David Milburn <dmilburn@redhat.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/rdma.c

index 1d8ea5305d60f009e0fd0cbe7af3acec7b249a52..3247d4ee46b1a25321920baea5bc43f14e4618f2 100644 (file)
@@ -835,6 +835,7 @@ static void nvme_rdma_destroy_admin_queue(struct nvme_rdma_ctrl *ctrl,
                blk_mq_free_tag_set(ctrl->ctrl.admin_tagset);
        }
        if (ctrl->async_event_sqe.data) {
+               cancel_work_sync(&ctrl->ctrl.async_event_work);
                nvme_rdma_free_qe(ctrl->device->dev, &ctrl->async_event_sqe,
                                sizeof(struct nvme_command), DMA_TO_DEVICE);
                ctrl->async_event_sqe.data = NULL;