From 0053cc2cfe544cda62a0bc0c2bd26ca7142c74a7 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Fri, 21 May 1999 08:23:58 +0000 Subject: [PATCH] Silently return NULL from devclass_get_device if dc == NULL. The caller should be handling NULL returns already. Submitted by: Andrew Gallatin --- sys/kern/subr_bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 1e70ff17decb..136880ae8f76 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: subr_bus.c,v 1.22 1999/05/14 09:13:43 dfr Exp $ + * $Id: subr_bus.c,v 1.23 1999/05/14 11:22:42 dfr Exp $ */ #include @@ -409,7 +409,7 @@ devclass_get_name(devclass_t dc) device_t devclass_get_device(devclass_t dc, int unit) { - if (unit < 0 || unit >= dc->maxunit) + if (dc == NULL || unit < 0 || unit >= dc->maxunit) return NULL; return dc->devices[unit]; }