summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/ugen.c
diff options
context:
space:
mode:
authormbalmer <mbalmer@openbsd.org>2007-06-11 12:36:52 +0000
committermbalmer <mbalmer@openbsd.org>2007-06-11 12:36:52 +0000
commit09a3b72c01f8616ae6be14a3bc258b6fa0faf877 (patch)
tree150ed0d6d7da0868024d072f74ec208a5fde0a97 /sys/dev/usb/ugen.c
parentthere was code inside #if NPF > 0, but pf.h was not included, so it did (diff)
downloadwireguard-openbsd-09a3b72c01f8616ae6be14a3bc258b6fa0faf877.tar.xz
wireguard-openbsd-09a3b72c01f8616ae6be14a3bc258b6fa0faf877.zip
Remove the USB_GET_SC_OPEN macro. There is a double check for sc == NULL in
ulpt.c, I am aware of that and it will be changed later. No binary change. ok mk.
Diffstat (limited to 'sys/dev/usb/ugen.c')
-rw-r--r--sys/dev/usb/ugen.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index 9845271716e..b57bb9aaa7f 100644
--- a/sys/dev/usb/ugen.c
+++ b/sys/dev/usb/ugen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ugen.c,v 1.45 2007/06/11 10:58:21 mbalmer Exp $ */
+/* $OpenBSD: ugen.c,v 1.46 2007/06/11 12:36:52 mbalmer 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 $ */
@@ -274,7 +274,11 @@ ugenopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
void *buf;
int i, j;
- USB_GET_SC_OPEN(ugen, unit, sc);
+ if (unit >= ugen_cd.cd_ndevs)
+ return (ENXIO);
+ sc = ugen_cd.cd_devs[unit];
+ if (sc == NULL)
+ return (ENXIO);
DPRINTFN(5, ("ugenopen: flag=%d, mode=%d, unit=%d endpt=%d\n",
flag, mode, unit, endpt));