]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/amd: Fix alloc_irq_index() increment
authorAlex Williamson <alex.williamson@redhat.com>
Fri, 3 Nov 2017 16:50:31 +0000 (10:50 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Fri, 3 Nov 2017 16:50:31 +0000 (10:50 -0600)
commit288547585196e6784ab2f83c2fd249890f79f32d
tree24218f13c7107d4079bbc0dc556aedf6a19d182f
parent8fe468de4fc9e8396980ba55d651cfb67226a3c1
iommu/amd: Fix alloc_irq_index() increment

On an is_allocated() interrupt index, we ALIGN() the current index and
then increment it via the for loop, guaranteeing that it is no longer
aligned for alignments >1.  We instead need to align the next index,
to guarantee forward progress, moving the increment-only to the case
where the index was found to be unallocated.

Fixes: 85030a8806cd ('iommu/amd: Add align parameter to alloc_irq_index()')
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/iommu/amd_iommu.c