PCI: hv: Fix an ignored error return from bitmap_find_free_region()
Subsystems (4)
PATCH v2 1/1 PCI: hv: Fix an ignored error return from bitmap_find_free_region()
An error return from bitmap_find_free_region() is currently ignored and we instead return a completely bogus *hwirq from hv_pci_vec_alloc_device_irq().
Reported-by Abaci Robot <[email protected]>
Fixes c10bdb758ca4 ("PCI: hv: Add arm64 Hyper-V vPCI support")
Signed-off-by Yang Li <[email protected]>
---
Change in v2:
--According to Bjorn's suggestion, the corresponding changes were made.
https://lore.kernel.org/lkml/20220111155412.GA142851@bhelgaas/
drivers/pci/controller/pci-hyperv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/pci-hyperv.c +1 -1
@@ -701,7 +701,7 @@ static int hv_pci_vec_alloc_device_irq(struct irq_domain *domain, irq_hw_number_t *hwirq) {struct hv_pci_chip_data *chip_data = domain->host_data; -unsigned int index; +int index;/* Find and allocate region from the SPI bitmap */ mutex_lock (&chip_data->map_lock);
Signature · 1 line
2.20.1.7.g153144c
Quoted 7 lines · Yang Li
An error return from
bitmap_find_free_region()is currently ignored and we instead return a completely bogus *hwirq fromhv_pci_vec_alloc_device_irq().Reported-by Abaci Robot <[email protected]>Fixes c10bdb758ca4 ("PCI: hv: Add arm64 Hyper-V vPCI support")Signed-off-by Yang Li <[email protected]>
Thanks, I squashed this into c10bdb758ca4.
Quoted 25 lines
---
Change in v2:
--According to Bjorn's suggestion, the corresponding changes were made.
https://lore.kernel.org/lkml/20220111155412.GA142851@bhelgaas/drivers/pci/controller/pci-hyperv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pci/controller/pci-hyperv.c +1
-1@@ -701,7 +701,7 @@ static int hv_pci_vec_alloc_device_irq(struct irq_domain *domain, irq_hw_number_t *hwirq) {struct hv_pci_chip_data *chip_data = domain->host_data; -unsigned int index; +int index;/* Find and allocate region from the SPI bitmap */ mutex_lock (&chip_data->map_lock);Signature · 1 line
2.20.1.7.g153144c