powerpc/msi: Treat bitmap size as allocation failure

bitmap_find_next_zero_area() uses an out-of-range return value to
indicate failure. Check for values greater than or equal to the bitmap
size so the caller does not depend on the exact failure sentinel.

Acked-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Signed-off-by: Yury Norov <ynorov@nvidia.com>
This commit is contained in:
Yury Norov
2026-07-08 22:03:08 -04:00
parent d00e89988e
commit 6abf50fde2

View File

@@ -21,7 +21,7 @@ int msi_bitmap_alloc_hwirqs(struct msi_bitmap *bmp, int num)
offset = bitmap_find_next_zero_area(bmp->bitmap, bmp->irq_count, 0,
num, (1 << order) - 1);
if (offset > bmp->irq_count)
if (offset >= bmp->irq_count)
goto err;
bitmap_set(bmp->bitmap, offset, num);