Skip to content

Commit

Permalink
[POWERPC] mpic_pasemi_msi: 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 54ef0ec commit ee1a08f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/powerpc/sysdev/mpic_pasemi_msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ static int pasemi_msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
unsigned int virq;
struct msi_desc *entry;
struct msi_msg msg;
int ret;

pr_debug("pasemi_msi_setup_msi_irqs, pdev %p nvec %d type %d\n",
pdev, nvec, type);
Expand All @@ -108,8 +109,9 @@ static int pasemi_msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
* few MSIs for someone, but restrictions will apply to how the
* sources can be changed independently.
*/
hwirq = mpic_msi_alloc_hwirqs(msi_mpic, ALLOC_CHUNK);
if (hwirq < 0) {
ret = mpic_msi_alloc_hwirqs(msi_mpic, ALLOC_CHUNK);
hwirq = ret;
if (ret < 0) {
pr_debug("pasemi_msi: failed allocating hwirq\n");
return hwirq;
}
Expand Down

0 comments on commit ee1a08f

Please sign in to comment.