diff options
author | Marc Balmer <mbalmer@cvs.openbsd.org> | 2007-06-11 12:36:54 +0000 |
---|---|---|
committer | Marc Balmer <mbalmer@cvs.openbsd.org> | 2007-06-11 12:36:54 +0000 |
commit | 6c2d41245ee67a282a457622925eb8223e42d4ad (patch) | |
tree | 7cd0224b4481980f6ecc742eaa16456e91b6ccf3 /sys/dev/usb/urio.c | |
parent | 9f1e83adf5a46e00e53fe55de42cb2e82aafccce (diff) |
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/urio.c')
-rw-r--r-- | sys/dev/usb/urio.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/usb/urio.c b/sys/dev/usb/urio.c index 7cb9fd00d62..21117ac6501 100644 --- a/sys/dev/usb/urio.c +++ b/sys/dev/usb/urio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: urio.c,v 1.28 2007/06/11 10:58:21 mbalmer Exp $ */ +/* $OpenBSD: urio.c,v 1.29 2007/06/11 12:36:52 mbalmer Exp $ */ /* $NetBSD: urio.c,v 1.15 2002/10/23 09:14:02 jdolecek Exp $ */ /* @@ -252,7 +252,11 @@ urioopen(dev_t dev, int flag, int mode, usb_proc_ptr p) struct urio_softc *sc; usbd_status err; - USB_GET_SC_OPEN(urio, URIOUNIT(dev), sc); + if (URIOUNIT(dev) >= urio_cd.cd_ndevs) + return (ENXIO); + sc = urio_cd.cd_devs[URIOUNIT(dev)]; + if (sc == NULL) + return (ENXIO); DPRINTFN(5, ("urioopen: flag=%d, mode=%d, unit=%d\n", flag, mode, URIOUNIT(dev))); |