Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b226a02 authored by Amit Engel's avatar Amit Engel Committed by Greg Kroah-Hartman
Browse files

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: default avatarAmit Engel <Amit.Engel@dell.com>
Reviewed-by: default avatarJames Smart <jsmart2021@gmail.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 7ad9a9eb
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);
			}
		}
	}