linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next v2] PCI: hv: Fix an ignored error return from bitmap_find_free_region()
@ 2022-01-12  0:33 Yang Li
  2022-01-12 14:26 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2022-01-12  0:33 UTC (permalink / raw)
  To: helgaas, kys
  Cc: sunilmut, haiyangz, sthemmin, wei.liu, decui, lorenzo.pieralisi,
	robh, kw, bhelgaas, mikelley, maz, linux-hyperv, linux-pci,
	linux-kernel, Yang Li, Abaci Robot

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 <abaci@linux.alibaba.com>
Fixes: c10bdb758ca4 ("PCI: hv: Add arm64 Hyper-V vPCI support")
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---

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(-)

diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
index 26c9c8ec0989..20ea2ee330b8 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -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);
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next v2] PCI: hv: Fix an ignored error return from bitmap_find_free_region()
  2022-01-12  0:33 [PATCH -next v2] PCI: hv: Fix an ignored error return from bitmap_find_free_region() Yang Li
@ 2022-01-12 14:26 ` Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2022-01-12 14:26 UTC (permalink / raw)
  To: Yang Li
  Cc: kys, sunilmut, haiyangz, sthemmin, wei.liu, decui,
	lorenzo.pieralisi, robh, kw, bhelgaas, mikelley, maz,
	linux-hyperv, linux-pci, linux-kernel, Abaci Robot

On Wed, Jan 12, 2022 at 08:33:24AM +0800, Yang Li wrote:
> 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 <abaci@linux.alibaba.com>
> Fixes: c10bdb758ca4 ("PCI: hv: Add arm64 Hyper-V vPCI support")
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>

Thanks, I squashed this into c10bdb758ca4.

> ---
> 
> 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(-)
> 
> diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> index 26c9c8ec0989..20ea2ee330b8 100644
> --- a/drivers/pci/controller/pci-hyperv.c
> +++ b/drivers/pci/controller/pci-hyperv.c
> @@ -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);
> -- 
> 2.20.1.7.g153144c
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-12 14:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-12  0:33 [PATCH -next v2] PCI: hv: Fix an ignored error return from bitmap_find_free_region() Yang Li
2022-01-12 14:26 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).