]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC 340441: Revert r332735 and fix MSI-X to properly fail allocations when full.
authorjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 29 Dec 2018 01:19:14 +0000 (01:19 +0000)
committerjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 29 Dec 2018 01:19:14 +0000 (01:19 +0000)
commit7110510f3eb0cbd2ea6bfb892125f6751377f76e
treed4167a87dc72fcbc36401e8ac11ca84656b4f872
parent89c532d3b6ab647684861e3a610f0cb6a57dee03
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342587 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/x86/x86/msi.c