summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Engel <Amit.Engel@dell.com>2023-01-23 15:37:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-22 14:47:19 +0300
commit8b226a02d18685a5ba2534bb33e7398bd5f5eac7 (patch)
tree1256872df83a8cae60b078779d1d95fdad293110
parent7ad9a9eb2e08dc88557cf9a2653d56c9f9ea152a (diff)
downloadlinux-8b226a02d18685a5ba2534bb33e7398bd5f5eac7.tar.xz
nvme-fc: fix a missing queue put in nvmet_fc_ls_create_association
[ Upstream commit 0cab4404874f2de52617de8400c844891c6ea1ce ] 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 <Amit.Engel@dell.com> Reviewed-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/nvme/target/fc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
index 77e4d184bc99..68d128b895ab 100644
--- a/drivers/nvme/target/fc.c
+++ b/drivers/nvme/target/fc.c
@@ -1325,8 +1325,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);
+ }
}
}