Skip to content

Commit 1a90956

Browse files
igawChristoph Hellwig
authored andcommitted
nvmet-fc: update tgtport ref per assoc
We need to take for each unique association a reference. nvmet_fc_alloc_hostport for each newly created association. Signed-off-by: Daniel Wagner <wagi@kernel.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 8851756 commit 1a90956

File tree

1 file changed

+3
-0
lines changed
  • drivers/nvme/target

1 file changed

+3
-0
lines changed

drivers/nvme/target/fc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,7 @@ nvmet_fc_alloc_target_assoc(struct nvmet_fc_tgtport *tgtport, void *hosthandle)
11271127
goto out_ida;
11281128

11291129
assoc->tgtport = tgtport;
1130+
nvmet_fc_tgtport_get(tgtport);
11301131
assoc->a_id = idx;
11311132
INIT_LIST_HEAD(&assoc->a_list);
11321133
kref_init(&assoc->ref);
@@ -1228,6 +1229,8 @@ nvmet_fc_delete_target_assoc(struct nvmet_fc_tgt_assoc *assoc)
12281229
dev_info(tgtport->dev,
12291230
"{%d:%d} Association deleted\n",
12301231
tgtport->fc_target_port.port_num, assoc->a_id);
1232+
1233+
nvmet_fc_tgtport_put(tgtport);
12311234
}
12321235

12331236
static struct nvmet_fc_tgt_assoc *

0 commit comments

Comments
 (0)