summaryrefslogtreecommitdiff
path: root/arch/powerpc/sysdev/mpic_u3msi.c
diff options
context:
space:
mode:
authorRoel Kluin <12o3l@tiscali.nl>2008-04-24 09:03:02 +1000
committerPaul Mackerras <paulus@samba.org>2008-05-14 22:31:25 +1000
commit9d5f525b86453da921360727112161254accc8c1 (patch)
treea87bd5c9e4d94ddef0724bb68a4ed1815e552d84 /arch/powerpc/sysdev/mpic_u3msi.c
parentee1a08f963c5abb5ec2d8c5defffecee7c3f84c8 (diff)
[POWERPC] mpic_u3msi: Failed allocation unnoticed
bitmap_find_free_region(), called by mpic_msi_alloc_hwirqs() may return signed, but hwirq is unsigned. A failed allocation remains unnoticed. Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/sysdev/mpic_u3msi.c')
-rw-r--r--arch/powerpc/sysdev/mpic_u3msi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/powerpc/sysdev/mpic_u3msi.c b/arch/powerpc/sysdev/mpic_u3msi.c
index 1d5a40899b74..6e2f8686fdfc 100644
--- a/arch/powerpc/sysdev/mpic_u3msi.c
+++ b/arch/powerpc/sysdev/mpic_u3msi.c
@@ -115,17 +115,19 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
struct msi_desc *entry;
struct msi_msg msg;
u64 addr;
+ int ret;
addr = find_ht_magic_addr(pdev);
msg.address_lo = addr & 0xFFFFFFFF;
msg.address_hi = addr >> 32;
list_for_each_entry(entry, &pdev->msi_list, list) {
- hwirq = mpic_msi_alloc_hwirqs(msi_mpic, 1);
- if (hwirq < 0) {
+ ret = mpic_msi_alloc_hwirqs(msi_mpic, 1);
+ if (ret < 0) {
pr_debug("u3msi: failed allocating hwirq\n");
- return hwirq;
+ return ret;
}
+ hwirq = ret;
virq = irq_create_mapping(msi_mpic->irqhost, hwirq);
if (virq == NO_IRQ) {