diff options
| author | knakahara <knakahara@NetBSD.org> | 2019-01-24 09:33:03 +0000 |
|---|---|---|
| committer | knakahara <knakahara@NetBSD.org> | 2019-01-24 09:33:03 +0000 |
| commit | bad41ba12ddc3ecf989edecba4735bbe15a0e216 (patch) | |
| tree | 383e800fa332ed756544189993608f451841c3f9 /sys/dev/bluetooth | |
| parent | 089a2e5b2b9903a3f61475fb164f76954225b0c2 (diff) | |
Add comments about D_MPSAFE to functions called as struct linesw.l_ioctl.
Diffstat (limited to 'sys/dev/bluetooth')
| -rw-r--r-- | sys/dev/bluetooth/bcsp.c | 10 | ||||
| -rw-r--r-- | sys/dev/bluetooth/btuart.c | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/sys/dev/bluetooth/bcsp.c b/sys/dev/bluetooth/bcsp.c index 2e452d7e158..960d21848ab 100644 --- a/sys/dev/bluetooth/bcsp.c +++ b/sys/dev/bluetooth/bcsp.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcsp.c,v 1.30 2016/08/15 08:20:11 maxv Exp $ */ +/* $NetBSD: bcsp.c,v 1.31 2019/01/24 09:33:03 knakahara Exp $ */ /* * Copyright (c) 2007 KIYOHARA Takashi * All rights reserved. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: bcsp.c,v 1.30 2016/08/15 08:20:11 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcsp.c,v 1.31 2019/01/24 09:33:03 knakahara Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -467,6 +467,12 @@ bcspioctl(struct tty *tp, u_long cmd, void *data, int flag __unused, struct bcsp_softc *sc = tp->t_sc; int error; + /* + * XXX + * This function can be called without KERNEL_LOCK when caller's + * struct cdevsw is set D_MPSAFE. Is KERNEL_LOCK required? + */ + if (sc == NULL || tp != sc->sc_tp) return EPASSTHROUGH; diff --git a/sys/dev/bluetooth/btuart.c b/sys/dev/bluetooth/btuart.c index d8943b2e808..ac1a3a9bcc6 100644 --- a/sys/dev/bluetooth/btuart.c +++ b/sys/dev/bluetooth/btuart.c @@ -1,4 +1,4 @@ -/* $NetBSD: btuart.c,v 1.28 2015/08/20 14:40:17 christos Exp $ */ +/* $NetBSD: btuart.c,v 1.29 2019/01/24 09:33:03 knakahara Exp $ */ /*- * Copyright (c) 2006, 2007 KIYOHARA Takashi @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: btuart.c,v 1.28 2015/08/20 14:40:17 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: btuart.c,v 1.29 2019/01/24 09:33:03 knakahara Exp $"); #include <sys/param.h> #include <sys/conf.h> @@ -313,6 +313,12 @@ btuartioctl(struct tty *tp, u_long cmd, void *data __unused, struct btuart_softc *sc = tp->t_sc; int error; + /* + * XXX + * This function can be called without KERNEL_LOCK when caller's + * struct cdevsw is set D_MPSAFE. Is KERNEL_LOCK required? + */ + if (sc == NULL || tp != sc->sc_tp) return EPASSTHROUGH; |
