diff options
author | Amit Engel <[email protected]> | 2023-01-23 14:37:28 +0200 |
---|---|---|
committer | Christoph Hellwig <[email protected]> | 2023-02-01 14:18:46 +0100 |
commit | 0cab4404874f2de52617de8400c844891c6ea1ce (patch) | |
tree | 9ceccea79cc7da76f4f1f50b6faa885e15bfb16c | |
parent | 81ea42b9c3d61ea34d82d900ed93f4b4851f13b0 (diff) |
nvme-fc: fix a missing queue put in nvmet_fc_ls_create_association
As part of nvmet_fc_ls_create_association there is a case where
nvmet_fc_alloc_target_queue fails right after a new association with an
admin queue is created. In this case, no one releases the get taken in
nvmet_fc_alloc_target_assoc. This fix is adding the missing put.
Signed-off-by: Amit Engel <[email protected]>
Reviewed-by: James Smart <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
-rw-r--r-- | drivers/nvme/target/fc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index ab2627e17bb9..1ab6601fdd5c 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c @@ -1685,8 +1685,10 @@ nvmet_fc_ls_create_association(struct nvmet_fc_tgtport *tgtport, else { queue = nvmet_fc_alloc_target_queue(iod->assoc, 0, be16_to_cpu(rqst->assoc_cmd.sqsize)); - if (!queue) + if (!queue) { ret = VERR_QUEUE_ALLOC_FAIL; + nvmet_fc_tgt_a_put(iod->assoc); + } } } |