Skip to content

Commit

Permalink
[POWERPC] mpic_u3msi: Failed allocation unnoticed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roel Kluin authored and Paul Mackerras committed May 14, 2008
1 parent ee1a08f commit 9d5f525
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions arch/powerpc/sysdev/mpic_u3msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9d5f525

Please sign in to comment.