[PATCH] nvme: target: clean assoc pointer after releasing its refcnt

Nil Yi teroincn at 163.com
Sat Aug 14 05:28:34 PDT 2021


After releasing the refcnt of iod->assoc, we should assign
NULL to it.

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 22b510816..c6c1839b4 100644
--- a/drivers/nvme/target/fc.c
+++ b/drivers/nvme/target/fc.c
@@ -1780,6 +1780,7 @@ nvmet_fc_ls_create_connection(struct nvmet_fc_tgtport *tgtport,
 
 			/* release get taken in nvmet_fc_find_target_assoc */
 			nvmet_fc_tgt_a_put(iod->assoc);
+			iod->assoc = NULL;
 		}
 	}
 
-- 
2.17.1





More information about the Linux-nvme mailing list