Skip to content

Commit ca121a0

Browse files
igawkeithbusch
authored andcommitted
nvmet-fc: hold reference on hostport match
The hostport data structure is shared between the association, this why we keep track of the users via a refcount. So we should not decrement the refcount on a match and free the hostport several times. Reported by KASAN. Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Daniel Wagner <dwagner@suse.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent c5e27b1 commit ca121a0

File tree

1 file changed

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

1 file changed

+0
-2
lines changed

drivers/nvme/target/fc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,8 +1068,6 @@ nvmet_fc_alloc_hostport(struct nvmet_fc_tgtport *tgtport, void *hosthandle)
10681068
/* new allocation not needed */
10691069
kfree(newhost);
10701070
newhost = match;
1071-
/* no new allocation - release reference */
1072-
nvmet_fc_tgtport_put(tgtport);
10731071
} else {
10741072
newhost->tgtport = tgtport;
10751073
newhost->hosthandle = hosthandle;

0 commit comments

Comments
 (0)