From: mbalmer Date: Thu, 10 Jul 2008 13:48:54 +0000 (+0000) Subject: Don't terminate the array of matching product/vendor IDs with { 0, 0 } X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=67c36599dbb286967847228e907e180374eda3ca;p=openbsd Don't terminate the array of matching product/vendor IDs with { 0, 0 } when usb_lookup is used. If a device indeed has 0 as vendor and product ID, like the HP DL165 BMC Server Engines SE USB Device, a wrong driver will attach and the machine will most pbly crash. Problem reported Rivo Nurges cvs: ---------------------------------------------------------------------- --- diff --git a/sys/dev/usb/ubt.c b/sys/dev/usb/ubt.c index 8ee2bbae84a..a929075b84f 100644 --- a/sys/dev/usb/ubt.c +++ b/sys/dev/usb/ubt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ubt.c,v 1.12 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: ubt.c,v 1.13 2008/07/10 13:48:54 mbalmer Exp $ */ /* $NetBSD: ubt.c,v 1.30 2007/12/16 19:01:37 christos Exp $ */ /*- @@ -290,8 +290,7 @@ static void ubt_abortdealloc(struct ubt_softc *); * to the ubt_ignore list. */ static const struct usb_devno ubt_ignore[] = { - { USB_VENDOR_BROADCOM, USB_PRODUCT_BROADCOM_BCM2033NF }, - { 0, 0 } /* end of list */ + { USB_VENDOR_BROADCOM, USB_PRODUCT_BROADCOM_BCM2033NF } }; int diff --git a/sys/dev/usb/udcf.c b/sys/dev/usb/udcf.c index 9500b2cd58a..711b18fbaa7 100644 --- a/sys/dev/usb/udcf.c +++ b/sys/dev/usb/udcf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udcf.c,v 1.43 2008/07/06 10:00:47 mbalmer Exp $ */ +/* $OpenBSD: udcf.c,v 1.44 2008/07/10 13:48:54 mbalmer Exp $ */ /* * Copyright (c) 2006, 2007, 2008 Marc Balmer @@ -160,8 +160,7 @@ const struct cfattach udcf_ca = { static const struct usb_devno udcf_devs[] = { { USB_VENDOR_GUDE, USB_PRODUCT_GUDE_DCF }, { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_DCF }, - { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_HBG }, - { 0, 0 } + { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_HBG } }; int diff --git a/sys/dev/usb/uftdi.c b/sys/dev/usb/uftdi.c index 069f78a4a6d..e963695f642 100644 --- a/sys/dev/usb/uftdi.c +++ b/sys/dev/usb/uftdi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uftdi.c,v 1.49 2008/06/26 05:42:18 ray Exp $ */ +/* $OpenBSD: uftdi.c,v 1.50 2008/07/10 13:48:54 mbalmer Exp $ */ /* $NetBSD: uftdi.c,v 1.14 2003/02/23 04:20:07 simonb Exp $ */ /* @@ -398,8 +398,7 @@ static const struct usb_devno uftdi_devs[] = { { USB_VENDOR_TESTO, USB_PRODUCT_TESTO_SERIAL_1 }, { USB_VENDOR_TESTO, USB_PRODUCT_TESTO_SERIAL_2 }, { USB_VENDOR_TESTO, USB_PRODUCT_TESTO_SERVICE }, - { USB_VENDOR_THURLBY, USB_PRODUCT_THURLBY_QL355P }, - { 0, 0 } + { USB_VENDOR_THURLBY, USB_PRODUCT_THURLBY_QL355P } }; int