]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC 340441: Revert r332735 and fix MSI-X to properly fail allocations when full.
authorjhb <jhb@FreeBSD.org>
Sat, 29 Dec 2018 01:19:14 +0000 (01:19 +0000)
committerjhb <jhb@FreeBSD.org>
Sat, 29 Dec 2018 01:19:14 +0000 (01:19 +0000)
commitb1a333c758eccf48461353ae108e277295966200
tree4fbed0cf959b0a7918ad56e8df7d6b23eacb8249
parenta13a3d13dedd619facc50f9c93e07414930ef5d2
MFC 340441: Revert r332735 and fix MSI-X to properly fail allocations when full.

The off-by-one errors in 332735 weren't actual errors and were
preventing the last MSI interrupt source from being used.  Instead,
the issue is that when all MSI interrupt sources were allocated, the
loop in msix_alloc() would terminate with 'msi' still set to non-null.
The only check for 'i' overflowing was in the 'msi' == NULL case, so
msix_alloc() would try to reuse the last MSI interrupt source instead
of failing.

Fix by moving the check for all sources being in use to just after the
loop.
sys/x86/x86/msi.c