]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvmet-fc: take tgtport reference only once
authorDaniel Wagner <wagi@kernel.org>
Tue, 8 Apr 2025 15:29:09 +0000 (17:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:44:37 +0000 (07:44 +0200)
commit33acc9c2d1e4890a6e60df3c8f3d0282582692db
tree9b2421b9fc56345ea3f2da17f061d20cbd669b06
parentb6a2cd26bcb96037a20e61d2c87c7e5568a7c7b9
nvmet-fc: take tgtport reference only once

[ Upstream commit b0b26ad0e1943de25ce82a7e5af3574f31b1cf99 ]

The reference counting code can be simplified. Instead taking a tgtport
refrerence at the beginning of nvmet_fc_alloc_hostport and put it back
if not a new hostport object is allocated, only take it when a new
hostport object is allocated.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/target/fc.c