git: f6bd65e922f6 - main - snp(4): drain snp_outpoll before destroying the open data

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Tue, 24 Nov 2026 03:52:35 UTC
The branch main has been updated by kib:

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

commit f6bd65e922f6acb0756f9e7d0610a23ec7f69318
Author:     Laam Alif <laamalif@proton.me>
AuthorDate: 2026-11-24 03:23:21 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-11-24 03:52:08 +0000

    snp(4): drain snp_outpoll before destroying the open data
    
    kib' note: comparing to the original submission, seldrain() is called
    before cv_destroy().
    
    PR:     301062
    MFC after:      1 week
---
 sys/dev/snp/snp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c
index 82b2f44e068b..0a9b7d378c76 100644
--- a/sys/dev/snp/snp.c
+++ b/sys/dev/snp/snp.c
@@ -125,6 +125,7 @@ snp_dtor(void *data)
 		ss->snp_tty = NULL;
 	}
 
+	seldrain(&ss->snp_outpoll);
 	cv_destroy(&ss->snp_outwait);
 	free(ss, M_SNP);
 }