summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhci.c
diff options
context:
space:
mode:
authornordin <nordin@openbsd.org>2002-01-10 00:46:36 +0000
committernordin <nordin@openbsd.org>2002-01-10 00:46:36 +0000
commit0e7f112ae907327307713a3378fefe6df5e5e56c (patch)
treec814a62d15032745cfac34d0b22c36c58106fdb0 /sys/dev/usb/uhci.c
parentChange 1st arg in pthread_attr_getdetachstate to const. (diff)
downloadwireguard-openbsd-0e7f112ae907327307713a3378fefe6df5e5e56c.tar.xz
wireguard-openbsd-0e7f112ae907327307713a3378fefe6df5e5e56c.zip
Check result from malloc(9) when using M_NOWAIT. nate@ ok
Diffstat (limited to 'sys/dev/usb/uhci.c')
-rw-r--r--sys/dev/usb/uhci.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index 50f06ec2dbb..d6c71087c94 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci.c,v 1.22 2001/10/31 04:24:44 nate Exp $ */
+/* $OpenBSD: uhci.c,v 1.23 2002/01/10 00:46:36 nordin Exp $ */
/* $NetBSD: uhci.c,v 1.142 2001/10/25 02:08:13 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -595,6 +595,8 @@ uhci_allocm(struct usbd_bus *bus, usb_dma_t *dma, u_int32_t size)
uhci_soft_td_t **stds;
DPRINTF(("uhci_allocm: get %d TDs\n", n));
stds = malloc(sizeof(uhci_soft_td_t *) * n, M_TEMP, M_NOWAIT);
+ if (stds == NULL)
+ panic("uhci_allocm");
memset(stds, 0, sizeof(uhci_soft_td_t *) * n);
for(i=0; i < n; i++)
stds[i] = uhci_alloc_std(sc);