diff options
| author | riastradh <riastradh@NetBSD.org> | 2022-01-14 22:28:42 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2022-01-14 22:28:42 +0000 |
| commit | 9b267cdd3c08eca5e9e71c844654a3b1a4658e8a (patch) | |
| tree | ca2944ba254f94ea26ff322d76e4cda2985786fe /sys/dev | |
| parent | 46cb6454e9745fd01a84dd37d898e31861670e3a (diff) | |
ims(4): Sprinkle KERNEL_LOCKED_P assertions.
Access to the softc and hidms state is currently kernel-locked.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/i2c/ims.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/i2c/ims.c b/sys/dev/i2c/ims.c index 43d053563ec..b2e82f42d65 100644 --- a/sys/dev/i2c/ims.c +++ b/sys/dev/i2c/ims.c @@ -1,4 +1,4 @@ -/* $NetBSD: ims.c,v 1.3 2019/07/09 12:56:30 ryoon Exp $ */ +/* $NetBSD: ims.c,v 1.4 2022/01/14 22:28:42 riastradh Exp $ */ /* $OpenBSD ims.c,v 1.1 2016/01/12 01:11:15 jcs Exp $ */ /* @@ -20,7 +20,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ims.c,v 1.3 2019/07/09 12:56:30 ryoon Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ims.c,v 1.4 2022/01/14 22:28:42 riastradh Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -158,11 +158,13 @@ ims_detach(device_t self, int flags) return rv; } -void +void ims_childdet(device_t self, device_t child) { struct ims_softc *sc = device_private(self); + KASSERT(KERNEL_LOCKED_P()); + KASSERT(sc->sc_ms.hidms_wsmousedev == child); sc->sc_ms.hidms_wsmousedev = NULL; } @@ -184,6 +186,8 @@ ims_enable(void *v) struct ims_softc *sc = v; int error; + KASSERT(KERNEL_LOCKED_P()); + if (sc->sc_enabled) return EBUSY; @@ -201,6 +205,8 @@ ims_disable(void *v) { struct ims_softc *sc = v; + KASSERT(KERNEL_LOCKED_P()); + #ifdef DIAGNOSTIC if (!sc->sc_enabled) { printf("ums_disable: not enabled\n"); |
