linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: mpic_pasemi_msi: failed allocation unnoticed
@ 2008-04-23 16:51 Roel Kluin
  2008-04-23 16:54 ` [PATCH 2/2] " Roel Kluin
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Roel Kluin @ 2008-04-23 16:51 UTC (permalink / raw)
  To: paulus, linuxppc-dev; +Cc: lkml

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;
 		}

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

end of thread, other threads:[~2008-04-24  0:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-23 16:51 [PATCH] powerpc: mpic_pasemi_msi: failed allocation unnoticed Roel Kluin
2008-04-23 16:54 ` [PATCH 2/2] " Roel Kluin
2008-04-23 19:00 ` [PATCH 2/2] mpic_u3msi: mpic_u3msi: " Roel Kluin
2008-04-23 22:09   ` Segher Boessenkool
2008-04-23 22:25     ` [PATCH 2/2 v2] " Roel Kluin
2008-04-23 23:03       ` Roel Kluin
2008-04-23 23:36       ` Michael Ellerman
2008-04-24  0:42         ` Benjamin Herrenschmidt
2008-04-23 22:32 ` [PATCH 1/2 v2] powerpc: mpic_pasemi_msi: " Roel Kluin

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