[tip:,irq/core] genirq/msi: Use MSI_DESC_ALL in msi_add_simple_msi_descs()

Message ID 166869770955.4906.17167965142739919126.tip-bot2@tip-bot2
State New
Headers
Series [tip:,irq/core] genirq/msi: Use MSI_DESC_ALL in msi_add_simple_msi_descs() |

Commit Message

tip-bot2 for Thomas Gleixner Nov. 17, 2022, 3:08 p.m. UTC
  The following commit has been merged into the irq/core branch of tip:

Commit-ID:     befd780253e774ea9388dd8dfad7c627a0aa7e02
Gitweb:        https://git.kernel.org/tip/befd780253e774ea9388dd8dfad7c627a0aa7e02
Author:        Thomas Gleixner <tglx@linutronix.de>
AuthorDate:    Fri, 11 Nov 2022 14:54:20 +01:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Thu, 17 Nov 2022 15:15:18 +01:00

genirq/msi: Use MSI_DESC_ALL in msi_add_simple_msi_descs()

There are no associated MSI descriptors in the requested range when the MSI
descriptor allocation fails. Use MSI_DESC_ALL as the filter which prepares
the next step to get rid of the filter for freeing.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ashok Raj <ashok.raj@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20221111122013.831151822@linutronix.de

---
 kernel/irq/msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index a9ee535..bba6359 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -120,7 +120,7 @@  static int msi_add_simple_msi_descs(struct device *dev, unsigned int index, unsi
 fail_mem:
 	ret = -ENOMEM;
 fail:
-	msi_free_msi_descs_range(dev, MSI_DESC_NOTASSOCIATED, index, last);
+	msi_free_msi_descs_range(dev, MSI_DESC_ALL, index, last);
 	return ret;
 }