nvmet-fc: hold reference on hostport match
authorDaniel Wagner <dwagner@suse.de>
Wed, 31 Jan 2024 08:51:06 +0000 (09:51 +0100)
committerKeith Busch <kbusch@kernel.org>
Thu, 1 Feb 2024 15:44:51 +0000 (07:44 -0800)
commitca121a0f7515591dba0eb5532bfa7ace4dc153ce
tree3119221fcb2242b08ddb0def507b11a143753817
parentc5e27b1a779ec25779d04c3af65aebaee6bd4304
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>
drivers/nvme/target/fc.c