1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-26 16:18:31 +00:00

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
This commit is contained in:
Nick Hibma 2010-11-07 15:36:07 +00:00
parent 12af6654a3
commit 96a6480a53
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=214919

View File

@ -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);