summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorBret Lambert <blambert@cvs.openbsd.org>2009-07-19 08:16:07 +0000
committerBret Lambert <blambert@cvs.openbsd.org>2009-07-19 08:16:07 +0000
commitddd180af848e3d2125e1ceba31e33aa89a1b62a0 (patch)
tree2201872f08da866f4e81194b477dbf1921cf3842 /sys/dev
parent906efef01f5ab7d1d82c1f4358d4548429b929e3 (diff)
clalloc() can't fail, so there's no need to handle failure cases.
Change to void function. Also, no need to have global tty stats pointer, so just return it from clalloc, as the caller frees it immediately anyway. ok miod@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/ugen.c5
-rw-r--r--sys/dev/usb/uhid.c8
2 files changed, 5 insertions, 8 deletions
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index 09bda694e12..ce917b43ba5 100644
--- a/sys/dev/usb/ugen.c
+++ b/sys/dev/usb/ugen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ugen.c,v 1.57 2009/06/05 20:18:03 yuo Exp $ */
+/* $OpenBSD: ugen.c,v 1.58 2009/07/19 08:16:06 blambert Exp $ */
/* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */
/* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -323,8 +323,7 @@ ugenopen(dev_t dev, int flag, int mode, struct proc *p)
sce->ibuf = malloc(isize, M_USBDEV, M_WAITOK);
DPRINTFN(5, ("ugenopen: intr endpt=%d,isize=%d\n",
endpt, isize));
- if (clalloc(&sce->q, UGEN_IBSIZE, 0) == -1)
- return (ENOMEM);
+ clalloc(&sce->q, UGEN_IBSIZE, 0);
err = usbd_open_pipe_intr(sce->iface,
edesc->bEndpointAddress,
USBD_SHORT_XFER_OK, &sce->pipeh, sce,
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index 1ca438f34a6..57716e16a6f 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhid.c,v 1.42 2008/06/26 05:42:18 ray Exp $ */
+/* $OpenBSD: uhid.c,v 1.43 2009/07/19 08:16:06 blambert Exp $ */
/* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -261,10 +261,8 @@ uhidopen(dev_t dev, int flag, int mode, struct proc *p)
if (error)
return (error);
- if (clalloc(&sc->sc_q, UHID_BSIZE, 0) == -1) {
- uhidev_close(&sc->sc_hdev);
- return (ENOMEM);
- }
+ clalloc(&sc->sc_q, UHID_BSIZE, 0);
+
sc->sc_obuf = malloc(sc->sc_osize, M_USBDEV, M_WAITOK);
sc->sc_state &= ~UHID_IMMED;
sc->sc_async = NULL;