summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2006-04-14 22:25:42 +0000
committerchristos <christos@NetBSD.org>2006-04-14 22:25:42 +0000
commit84d09c873a084eac1545cdb15af48bcfb3d02e72 (patch)
tree986b5a3f15b0aae1c7c1530e2839a69619b44717 /sys/dev/usb
parentdf1efb824a3aa3ff0821801e975314581d8cf068 (diff)
Coverity CID 1356: Add KASSERT for NULL deref.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/umidi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/usb/umidi.c b/sys/dev/usb/umidi.c
index fe356e0dcb5..9e9d6d53cdc 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 <sys/cdefs.h>
-__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 <sys/param.h>
#include <sys/systm.h>
@@ -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)