Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1568427 > unrolled thread

[PATCH] PCI/MSI: Return error code if memory allocation fails

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2017-01-27 16:20 +0100
Last post2017-01-27 16:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] PCI/MSI: Return error code if memory allocation fails Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-01-27 16:20 +0100

#1568427 — [PATCH] PCI/MSI: Return error code if memory allocation fails

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2017-01-27 16:20 +0100
Subject[PATCH] PCI/MSI: Return error code if memory allocation fails
Message-ID<t4gtI-5Mm-9@gated-at.bofh.it>
If 'alloc_msi_entry()' fails, a few lines above, we free resources and set
'ret = -ENOMEM'.

However, the function returns 0, inconditionaly.
Returns the error code instead.

Fixes: e75eafb9b039 ("genirq/msi: Switch to new irq spreading infrastructure")

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/pci/msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index b6785c8be44d..0f77b38f03dd 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -731,7 +731,7 @@ static int msix_setup_entries(struct pci_dev *dev, void __iomem *base,
 	ret = 0;
 out:
 	kfree(masks);
-	return 0;
+	return ret;
 }
 
 static void msix_program_entries(struct pci_dev *dev,
-- 
2.9.3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web