diff options
| author | 2007-06-11 12:36:52 +0000 | |
|---|---|---|
| committer | 2007-06-11 12:36:52 +0000 | |
| commit | 09a3b72c01f8616ae6be14a3bc258b6fa0faf877 (patch) | |
| tree | 150ed0d6d7da0868024d072f74ec208a5fde0a97 /sys/dev/usb/ulpt.c | |
| parent | there was code inside #if NPF > 0, but pf.h was not included, so it did (diff) | |
| download | wireguard-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/ulpt.c')
| -rw-r--r-- | sys/dev/usb/ulpt.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c index 6203454ca2c..b70896e4913 100644 --- a/sys/dev/usb/ulpt.c +++ b/sys/dev/usb/ulpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ulpt.c,v 1.28 2007/06/11 10:58:21 mbalmer Exp $ */ +/* $OpenBSD: ulpt.c,v 1.29 2007/06/11 12:36:52 mbalmer Exp $ */ /* $NetBSD: ulpt.c,v 1.57 2003/01/05 10:19:42 scw Exp $ */ /* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */ @@ -422,7 +422,11 @@ ulptopen(dev_t dev, int flag, int mode, usb_proc_ptr p) usbd_status err; int spin, error; - USB_GET_SC_OPEN(ulpt, ULPTUNIT(dev), sc); + if (ULPTUNIT(dev) >= ulpt_cd.cd_ndevs) + return (ENXIO); + sc = ulpt_cd.cd_devs[ULPTUNIT(dev)]; + if (sc == NULL) + return (ENXIO); if (sc == NULL || sc->sc_iface == NULL || sc->sc_dying) return (ENXIO); |
