diff options
author | Daniel Wagner <dwagner@suse.de> | 2024-01-31 09:51:03 +0100 |
---|---|---|
committer | Keith Busch <kbusch@kernel.org> | 2024-02-01 16:44:46 +0100 |
commit | c691e6d7e13dab81ac8c7489c83b5dea972522a5 (patch) | |
tree | f96476801c7be431eba20ccc35e95f91dcfb7ac0 /drivers/nvme | |
parent | nvmet-fcloop: swap the list_add_tail arguments (diff) | |
download | linux-c691e6d7e13dab81ac8c7489c83b5dea972522a5.tar.xz linux-c691e6d7e13dab81ac8c7489c83b5dea972522a5.zip |
nvmet-fc: release reference on target port
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>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/target/fc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index 05e6a755b330..3d53d9dc1099 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c @@ -360,7 +360,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); @@ -373,6 +373,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); } |