From 49b21ad65b2941528116d8994080024d9fa4c7b4 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sat, 23 Aug 2003 16:58:36 +0000 Subject: [PATCH] Allow a NULL dev to be passed to _devsw(). This should close any remaining kernel panics related to non-existant devices. --- sys/kern/kern_device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_device.c b/sys/kern/kern_device.c index 256c1bf916..a22cfa9430 100644 --- a/sys/kern/kern_device.c +++ b/sys/kern/kern_device.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/kern_device.c,v 1.4 2003/08/12 02:36:15 dillon Exp $ + * $DragonFly: src/sys/kern/kern_device.c,v 1.5 2003/08/23 16:58:36 dillon Exp $ */ #include #include @@ -175,6 +175,8 @@ static __inline struct cdevsw * _devsw(dev_t dev) { + if (dev == NULL) + return(NULL); if (dev->si_devsw) return (dev->si_devsw); return(cdevsw[major(dev)]); -- 2.41.0