Skip to content

Commit

Permalink
nvme-fc: don't call nvme_cleanup_cmd() for AENs
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
igaw authored and axboe committed Jun 11, 2020
1 parent a40aae6 commit c9c12e5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/nvme/host/fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2634,10 +2634,11 @@ nvme_fc_start_fcp_op(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue,
opstate = atomic_xchg(&op->state, FCPOP_STATE_COMPLETE);
__nvme_fc_fcpop_chk_teardowns(ctrl, op, opstate);

if (!(op->flags & FCOP_FLAGS_AEN))
if (!(op->flags & FCOP_FLAGS_AEN)) {
nvme_fc_unmap_data(ctrl, op->rq, op);
nvme_cleanup_cmd(op->rq);
}

nvme_cleanup_cmd(op->rq);
nvme_fc_ctrl_put(ctrl);

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

0 comments on commit c9c12e5

Please sign in to comment.