From 6c2d41245ee67a282a457622925eb8223e42d4ad Mon Sep 17 00:00:00 2001 From: Marc Balmer Date: Mon, 11 Jun 2007 12:36:54 +0000 Subject: 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. --- sys/dev/usb/urio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sys/dev/usb/urio.c') 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))); -- cgit v1.2.3