diff options
author | Daniel Wagner <dwagner@suse.de> | 2023-06-06 15:24:11 +0300 |
---|---|---|
committer | Keith Busch <kbusch@kernel.org> | 2023-06-12 20:37:00 +0300 |
commit | d97b4111b3228122284df0263200f02fd44751fd (patch) | |
tree | e235ec3db1ca467337d8ce305ebdba673190aeb5 /drivers/nvme/target | |
parent | 959ffef13bac792e4e2e3321d6e2bd2b00c0f5f9 (diff) | |
download | linux-d97b4111b3228122284df0263200f02fd44751fd.tar.xz |
nvmet-fcloop: Do not wait on completion when unregister fails
The nvme_fc_unregister_localport() returns an error code in case that
the locaport pointer is NULL or has already been unegisterd. localport is
is either in the ONLINE state (all resources allocated) or has already
been put into DELETED state.
In this case we will never receive an wakeup call and thus any caller
will hang, e.g. module unload.
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'drivers/nvme/target')
-rw-r--r-- | drivers/nvme/target/fcloop.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/target/fcloop.c b/drivers/nvme/target/fcloop.c index 1ab3d900f2bf..c65a73433c05 100644 --- a/drivers/nvme/target/fcloop.c +++ b/drivers/nvme/target/fcloop.c @@ -1166,7 +1166,8 @@ __wait_localport_unreg(struct fcloop_lport *lport) ret = nvme_fc_unregister_localport(lport->localport); - wait_for_completion(&lport->unreg_done); + if (!ret) + wait_for_completion(&lport->unreg_done); kfree(lport); |