]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvmet-fc: hold reference on hostport match
authorDaniel Wagner <dwagner@suse.de>
Wed, 31 Jan 2024 08:51:06 +0000 (09:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:34:52 +0000 (13:34 +0100)
commitf2879398c295bc6016bc6854e94780ca694b3926
treebc5315a0379f04e1e8cac8499bf17a9677fde57b
parentccd49adde0547bd6b6c857909d1c4a3ad6ab93c0
nvmet-fc: hold reference on hostport match

[ Upstream commit ca121a0f7515591dba0eb5532bfa7ace4dc153ce ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/target/fc.c