[PATCH] nvme: target: set NULL to iod after assoc refcnt is released

Nil Yi teroincn at 163.com
Sat Aug 14 06:06:58 PDT 2021


After the refcount of assoc is released, the corresponding
pointer should be set to NULL.

Signed-off-by: Nil Yi <teroincn at 163.com>
---
 drivers/nvme/target/fc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
index c6c1839b4..8114cf678 100644
--- a/drivers/nvme/target/fc.c
+++ b/drivers/nvme/target/fc.c
@@ -1870,6 +1870,7 @@ nvmet_fc_ls_disconnect(struct nvmet_fc_tgtport *tgtport,
 
 	/* release get taken in nvmet_fc_find_target_assoc */
 	nvmet_fc_tgt_a_put(assoc);
+	iod->assoc = NULL;
 
 	/*
 	 * The rules for LS response says the response cannot
-- 
2.17.1





More information about the Linux-nvme mailing list