From 84d09c873a084eac1545cdb15af48bcfb3d02e72 Mon Sep 17 00:00:00 2001 From: christos Date: Fri, 14 Apr 2006 22:25:42 +0000 Subject: [PATCH] Coverity CID 1356: Add KASSERT for NULL deref. --- sys/dev/usb/umidi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/umidi.c b/sys/dev/usb/umidi.c index fe356e0dcb5a..9e9d6d53cdc4 100644 --- a/sys/dev/usb/umidi.c +++ b/sys/dev/usb/umidi.c @@ -1,4 +1,4 @@ -/* $NetBSD: umidi.c,v 1.24 2005/12/11 12:24:01 christos Exp $ */ +/* $NetBSD: umidi.c,v 1.25 2006/04/14 22:25:42 christos Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. * All rights reserved. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.24 2005/12/11 12:24:01 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.25 2006/04/14 22:25:42 christos Exp $"); #include #include @@ -534,6 +534,7 @@ alloc_all_endpoints_yamaha(struct umidi_softc *sc) desc = TO_D(usbd_get_interface_descriptor(sc->sc_iface)); for (i=(int)TO_IFD(desc)->bNumEndpoints-1; i>=0; i--) { epd = usbd_interface2endpoint_descriptor(sc->sc_iface, i); + KASSERT(epd != NULL); if (UE_GET_XFERTYPE(epd->bmAttributes) == UE_BULK) { dir = UE_GET_DIR(epd->bEndpointAddress); if (dir==UE_DIR_OUT && !out_addr)