[PATCH] powerpc: mpic_pasemi_msi: failed allocation unnoticed

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Roel Kluin
Date: Wednesday, April 23, 2008 - 9:51 am

bitmap_find_free_region(), called by mpic_msi_alloc_hwirqs() may
return -ENOMEM, but hwirq of type irq_hw_number_t which is unsigned.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
The functions can be found respectively in:
//---[ vi lib/bitmap.c +807 ]---
//---[ vi arch/powerpc/sysdev/mpic_msi.c +39 ]---

diff --git a/arch/powerpc/sysdev/mpic_pasemi_msi.c b/arch/powerpc/sysdev/mpic_pasemi_msi.c
index 33cbfb2..a15ac5c 100644
--- a/arch/powerpc/sysdev/mpic_pasemi_msi.c
+++ b/arch/powerpc/sysdev/mpic_pasemi_msi.c
@@ -109,7 +109,7 @@ static int pasemi_msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
 		 * sources can be changed independently.
 		 */
 		hwirq = mpic_msi_alloc_hwirqs(msi_mpic, ALLOC_CHUNK);
-		if (hwirq < 0) {
+		if (hwirq == -ENOMEM) {
 			pr_debug("pasemi_msi: failed allocating hwirq\n");
 			return hwirq;
 		}
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] powerpc: mpic_pasemi_msi: failed allocation unnoticed, Roel Kluin, (Wed Apr 23, 9:51 am)
Re: [PATCH 2/2] mpic_u3msi: mpic_u3msi: failed allocation ..., Segher Boessenkool, (Wed Apr 23, 3:09 pm)
Re: [PATCH 2/2 v2] mpic_u3msi: mpic_u3msi: failed allocati ..., Benjamin Herrenschmidt, (Wed Apr 23, 5:42 pm)