Skip to content

Commit

Permalink
nvmet-fc: release reference on target port
Browse files Browse the repository at this point in the history
[ Upstream commit c691e6d ]

In case we return early out of __nvmet_fc_finish_ls_req() we still have
to release the reference on the target port.

Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
igaw authored and gregkh committed Mar 1, 2024
1 parent 95a9ff3 commit 2baa727
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/nvme/target/fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ __nvmet_fc_finish_ls_req(struct nvmet_fc_ls_req_op *lsop)

if (!lsop->req_queued) {
spin_unlock_irqrestore(&tgtport->lock, flags);
return;
goto out_puttgtport;
}

list_del(&lsop->lsreq_list);
Expand All @@ -372,6 +372,7 @@ __nvmet_fc_finish_ls_req(struct nvmet_fc_ls_req_op *lsop)
(lsreq->rqstlen + lsreq->rsplen),
DMA_BIDIRECTIONAL);

out_puttgtport:
nvmet_fc_tgtport_put(tgtport);
}

Expand Down

0 comments on commit 2baa727

Please sign in to comment.