git: e11d11c543e7 - main - kinst: test lock in kinst_trampoline_dealloc_locked()

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 01 May 2023 15:40:48 UTC
The branch main has been updated by markj:

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

commit e11d11c543e7303685c8b5a32bb0338cd3e61f1e
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2023-05-01 15:22:37 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-05-01 15:40:29 +0000

    kinst: test lock in kinst_trampoline_dealloc_locked()
    
    Reviewed by:    markj
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D39883
---
 sys/cddl/dev/kinst/trampoline.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/cddl/dev/kinst/trampoline.c b/sys/cddl/dev/kinst/trampoline.c
index ba61faa2b3ab..6614a6ed9302 100644
--- a/sys/cddl/dev/kinst/trampoline.c
+++ b/sys/cddl/dev/kinst/trampoline.c
@@ -163,6 +163,8 @@ kinst_trampoline_dealloc_locked(uint8_t *tramp, bool freechunks)
 	struct trampchunk *chunk;
 	int off;
 
+	sx_assert(&kinst_tramp_sx, SX_XLOCKED);
+
 	if (tramp == NULL)
 		return;