Date: Sun, 7 Nov 2010 15:36:07 +0000 (UTC) From: Nick Hibma <n_hibma@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r214919 - head/sys/dev/usb/serial Message-ID: <201011071536.oA7Fa7Av055277@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: n_hibma Date: Sun Nov 7 15:36:07 2010 New Revision: 214919 URL: http://svn.freebsd.org/changeset/base/214919 Log: Bugfix: Set the bit that marks a device number in use. This would cause a panic when disconnecting the second serial device. Submitted by: Lucius Windschuh 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 Sun Nov 7 14:39:40 2010 (r214918) +++ head/sys/dev/usb/serial/usb_serial.c Sun Nov 7 15:36:07 2010 (r214919) @@ -200,9 +200,12 @@ ucom_unit_alloc(void) mtx_lock(&ucom_bitmap_mtx); - for (unit = 0; unit < UCOM_UNIT_MAX; unit++) - if ((ucom_bitmap[unit / 8] & (1 << (unit % 8))) == 0) + for (unit = 0; unit < UCOM_UNIT_MAX; unit++) { + if ((ucom_bitmap[unit / 8] & (1 << (unit % 8))) == 0) { + ucom_bitmap[unit / 8] |= (1 << (unit % 8)); break; + } + } mtx_unlock(&ucom_bitmap_mtx);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011071536.oA7Fa7Av055277>