Patch "nvme-fc: fix a missing queue put in nvmet_fc_ls_create_association" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    nvme-fc: fix a missing queue put in nvmet_fc_ls_create_association

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nvme-fc-fix-a-missing-queue-put-in-nvmet_fc_ls_creat.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 1b66a9becb4b95b8cdc27bab8c9fc283d4b120e5
Author: Amit Engel <Amit.Engel@xxxxxxxx>
Date:   Mon Jan 23 14:37:28 2023 +0200

    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@xxxxxxxx>
    Reviewed-by: James Smart <jsmart2021@xxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
index 9b07e8c7689ab..f74fc6481731d 100644
--- a/drivers/nvme/target/fc.c
+++ b/drivers/nvme/target/fc.c
@@ -1362,8 +1362,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);
+			}
 		}
 	}
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux