summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhid.c
diff options
context:
space:
mode:
authorblambert <blambert@openbsd.org>2009-07-19 08:16:06 +0000
committerblambert <blambert@openbsd.org>2009-07-19 08:16:06 +0000
commitd280fc84e3f11915535ced37f5f16f84d0af016d (patch)
tree68f0b0a11ebaee3b785663c78180510696c14b9b /sys/dev/usb/uhid.c
parentuse addr_eq() where we can; ok krw@ (diff)
downloadwireguard-openbsd-d280fc84e3f11915535ced37f5f16f84d0af016d.tar.xz
wireguard-openbsd-d280fc84e3f11915535ced37f5f16f84d0af016d.zip
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/usb/uhid.c')
-rw-r--r--sys/dev/usb/uhid.c8
1 files changed, 3 insertions, 5 deletions
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;