Skip to content

Commit d97b411

Browse files
igawkeithbusch
authored andcommitted
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 <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 959ffef commit d97b411

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/nvme/target/fcloop.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,8 @@ __wait_localport_unreg(struct fcloop_lport *lport)
11661166

11671167
ret = nvme_fc_unregister_localport(lport->localport);
11681168

1169-
wait_for_completion(&lport->unreg_done);
1169+
if (!ret)
1170+
wait_for_completion(&lport->unreg_done);
11701171

11711172
kfree(lport);
11721173

0 commit comments

Comments
 (0)