]> git.baikalelectronics.ru Git - kernel.git/commitdiff
nvme-fc: cancel async events before freeing event struct
authorDavid Milburn <dmilburn@redhat.com>
Wed, 2 Sep 2020 22:42:54 +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_fc_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/fc.c

index a7f474ddfff7615b82e3c8b511d20ff2cf29cc4a..e8ef42b9d50c233f4ab3cd6e841db393d22bccf2 100644 (file)
@@ -2160,6 +2160,7 @@ nvme_fc_term_aen_ops(struct nvme_fc_ctrl *ctrl)
        struct nvme_fc_fcp_op *aen_op;
        int i;
 
+       cancel_work_sync(&ctrl->ctrl.async_event_work);
        aen_op = ctrl->aen_ops;
        for (i = 0; i < NVME_NR_AEN_COMMANDS; i++, aen_op++) {
                __nvme_fc_exit_request(ctrl, aen_op);