From owner-p4-projects@FreeBSD.ORG Fri Sep 15 15:09:37 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AA6EA16A51B; Fri, 15 Sep 2006 15:09:37 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8550D16A500 for ; Fri, 15 Sep 2006 15:09:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A066F43D5A for ; Fri, 15 Sep 2006 15:09:33 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8FF9XCr002786 for ; Fri, 15 Sep 2006 15:09:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8FF9X6C002783 for perforce@freebsd.org; Fri, 15 Sep 2006 15:09:33 GMT (envelope-from hselasky@FreeBSD.org) Date: Fri, 15 Sep 2006 15:09:33 GMT Message-Id: <200609151509.k8FF9X6C002783@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106149 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 15:09:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=106149 Change 106149 by hselasky@hselasky_mini_itx on 2006/09/15 15:09:28 The "ucom" layer currently only supports devices that are in the "ucom_devclass", due to the need for unique unit numbers. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/ucom.c#8 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/ucom.c#8 (text+ko) ==== @@ -153,6 +153,15 @@ mtx_assert(&Giant, MA_OWNED); + if (device_get_devclass(dev) != ucom_devclass) { + /* NOTE: if all devices are not in the same + * devclass, we get duplicate unit numbers + * which will crash the TTY layer! + */ + error = EINVAL; + goto done; + } + unit = device_get_unit(dev); tp = ttyalloc();