Skip to content

Commit c9c12e5

Browse files
igawaxboe
authored andcommitted
nvme-fc: don't call nvme_cleanup_cmd() for AENs
Asynchronous event notifications do not have an associated request. When fcp_io() fails we unconditionally call nvme_cleanup_cmd() which leads to a crash. Fixes: 16686f3 ("nvme: move common call to nvme_cleanup_cmd to core layer") Signed-off-by: Daniel Wagner <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: James Smart <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent a40aae6 commit c9c12e5

File tree

1 file changed

+3
-2
lines changed
  • drivers/nvme/host

1 file changed

+3
-2
lines changed

drivers/nvme/host/fc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2634,10 +2634,11 @@ nvme_fc_start_fcp_op(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue,
26342634
opstate = atomic_xchg(&op->state, FCPOP_STATE_COMPLETE);
26352635
__nvme_fc_fcpop_chk_teardowns(ctrl, op, opstate);
26362636

2637-
if (!(op->flags & FCOP_FLAGS_AEN))
2637+
if (!(op->flags & FCOP_FLAGS_AEN)) {
26382638
nvme_fc_unmap_data(ctrl, op->rq, op);
2639+
nvme_cleanup_cmd(op->rq);
2640+
}
26392641

2640-
nvme_cleanup_cmd(op->rq);
26412642
nvme_fc_ctrl_put(ctrl);
26422643

26432644
if (ctrl->rport->remoteport.port_state == FC_OBJSTATE_ONLINE &&

0 commit comments

Comments
 (0)