Date: Mon, 10 Oct 2011 15:54:44 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r226219 - head/sys/dev/usb/serial Message-ID: <201110101554.p9AFsiJs068829@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Mon Oct 10 15:54:44 2011 New Revision: 226219 URL: http://svn.freebsd.org/changeset/base/226219 Log: Bugfix: The ucom detach function is sometimes called on zeroed structures. Check for this case and just return, so that the UCOM unit number zero is not accidentially freed. Submitted by: Danish FreeBSD user at EuroBSDcon 2011 MFC after: 3 days Modified: head/sys/dev/usb/serial/usb_serial.c Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Mon Oct 10 15:43:09 2011 (r226218) +++ head/sys/dev/usb/serial/usb_serial.c Mon Oct 10 15:54:44 2011 (r226219) @@ -289,6 +289,9 @@ ucom_detach(struct ucom_super_softc *ssc { uint32_t subunit; + if (ssc->sc_subunits == 0) + return; /* not initialized */ + usb_proc_drain(&ssc->sc_tq); for (subunit = 0; subunit < ssc->sc_subunits; subunit++) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110101554.p9AFsiJs068829>