git: a6ec2147418c - main - nvmf: Deregister the post_sync eventhandler correctly during detach

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Sat, 02 Nov 2024 13:54:56 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=a6ec2147418c29b259ff6b4f4274417b55419285

commit a6ec2147418c29b259ff6b4f4274417b55419285
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-11-02 13:54:36 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-11-02 13:54:36 +0000

    nvmf: Deregister the post_sync eventhandler correctly during detach
    
    Previously the handler was removed from the wrong eventhandler list.
    
    Fixes:          f46d4971b5af nvmf: Handle shutdowns more gracefully
    Sponsored by:   Chelsio Communications
---
 sys/dev/nvmf/host/nvmf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/nvmf/host/nvmf.c b/sys/dev/nvmf/host/nvmf.c
index 9d06b501d675..2c438db2eb23 100644
--- a/sys/dev/nvmf/host/nvmf.c
+++ b/sys/dev/nvmf/host/nvmf.c
@@ -780,7 +780,7 @@ nvmf_detach(device_t dev)
 	sx_xunlock(&sc->connection_lock);
 
 	EVENTHANDLER_DEREGISTER(shutdown_pre_sync, sc->shutdown_pre_sync_eh);
-	EVENTHANDLER_DEREGISTER(shutdown_pre_sync, sc->shutdown_post_sync_eh);
+	EVENTHANDLER_DEREGISTER(shutdown_post_sync, sc->shutdown_post_sync_eh);
 
 	nvmf_destroy_sim(sc);
 	for (i = 0; i < sc->cdata->nn; i++) {