summaryrefslogtreecommitdiff
path: root/drivers/nvme/target
diff options
context:
space:
mode:
authorDaniel Wagner <dwagner@suse.de>2024-01-31 11:51:06 +0300
committerKeith Busch <kbusch@kernel.org>2024-02-01 18:44:51 +0300
commitca121a0f7515591dba0eb5532bfa7ace4dc153ce (patch)
tree3119221fcb2242b08ddb0def507b11a143753817 /drivers/nvme/target
parentc5e27b1a779ec25779d04c3af65aebaee6bd4304 (diff)
downloadlinux-ca121a0f7515591dba0eb5532bfa7ace4dc153ce.tar.xz
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>
Diffstat (limited to 'drivers/nvme/target')
-rw-r--r--drivers/nvme/target/fc.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
index b44b99525c44..205a12b1e841 100644
--- a/drivers/nvme/target/fc.c
+++ b/drivers/nvme/target/fc.c
@@ -1068,8 +1068,6 @@ nvmet_fc_alloc_hostport(struct nvmet_fc_tgtport *tgtport, void *hosthandle)
/* new allocation not needed */
kfree(newhost);
newhost = match;
- /* no new allocation - release reference */
- nvmet_fc_tgtport_put(tgtport);
} else {
newhost->tgtport = tgtport;
newhost->hosthandle = hosthandle;