Skip to content

Commit c691e6d

Browse files
igawkeithbusch
authored andcommitted
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Daniel Wagner <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent dcfad4a commit c691e6d

File tree

1 file changed

+2
-1
lines changed
  • drivers/nvme/target

1 file changed

+2
-1
lines changed

drivers/nvme/target/fc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ __nvmet_fc_finish_ls_req(struct nvmet_fc_ls_req_op *lsop)
360360

361361
if (!lsop->req_queued) {
362362
spin_unlock_irqrestore(&tgtport->lock, flags);
363-
return;
363+
goto out_puttgtport;
364364
}
365365

366366
list_del(&lsop->lsreq_list);
@@ -373,6 +373,7 @@ __nvmet_fc_finish_ls_req(struct nvmet_fc_ls_req_op *lsop)
373373
(lsreq->rqstlen + lsreq->rsplen),
374374
DMA_BIDIRECTIONAL);
375375

376+
out_puttgtport:
376377
nvmet_fc_tgtport_put(tgtport);
377378
}
378379

0 commit comments

Comments
 (0)