nvme-fc: cancel async events before freeing event struct
[linux-2.6-block.git] / 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);