[PATCH v2 4/4] nvmet-fc: Release reference on target port

From: Daniel Wagner
Date: Tue Apr 11 2023 - 08:07:40 EST


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

Signed-off-by: Daniel Wagner <dwagner@xxxxxxx>
---
drivers/nvme/target/fc.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
index 1ab6601fdd5c..df7d84aff843 100644
--- a/drivers/nvme/target/fc.c
+++ b/drivers/nvme/target/fc.c
@@ -359,6 +359,7 @@ __nvmet_fc_finish_ls_req(struct nvmet_fc_ls_req_op *lsop)

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

--
2.40.0