From 569d3c4bf0802f48a62124eca8f6d35983715008 Mon Sep 17 00:00:00 2001 From: Alfred Perlstein Date: Thu, 13 Mar 2003 06:29:44 +0000 Subject: [PATCH] Make sure we actually have a dev before dereferencing in case someone botches and sends us a NULL pointer. The other code in this file seems to expect it to be able to handle it behaving this way. --- sys/kern/subr_bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 75529a0daaae..b6e8d213ee79 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -1154,7 +1154,7 @@ device_get_devclass(device_t dev) const char * device_get_name(device_t dev) { - if (dev->devclass) + if (dev != NULL && dev->devclass) return (devclass_get_name(dev->devclass)); return (NULL); }