diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-05-07 11:44:19 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-05-16 08:05:21 -0400 |
commit | 0a0a94219074d79370b1cd1b533ead63d51c3730 (patch) | |
tree | 2146718c8f6622d8c881ec99e74024eeaf6138ed /arch/s390/pci | |
parent | 3670802223e164f1089287d1c223d34d3c5dc3da (diff) |
s390: pci: Check return value of alloc_irq_desc() proper
alloc_irq_desc() returns an integer and as documented either a valid
irq number or a negative error code. Checking for NO_IRQ is definitely
not the proper error handling.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Grant Likely <grant.likely@linaro.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux390@de.ibm.com
Link: http://lkml.kernel.org/r/20140507154339.409085048@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/s390/pci')
-rw-r--r-- | arch/s390/pci/pci.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index 1df1d29ac81d..2c0076d462b8 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c | |||
@@ -401,11 +401,11 @@ static void zpci_irq_handler(struct airq_struct *airq) | |||
401 | int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | 401 | int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) |
402 | { | 402 | { |
403 | struct zpci_dev *zdev = get_zdev(pdev); | 403 | struct zpci_dev *zdev = get_zdev(pdev); |
404 | unsigned int hwirq, irq, msi_vecs; | 404 | unsigned int hwirq, msi_vecs; |
405 | unsigned long aisb; | 405 | unsigned long aisb; |
406 | struct msi_desc *msi; | 406 | struct msi_desc *msi; |
407 | struct msi_msg msg; | 407 | struct msi_msg msg; |
408 | int rc; | 408 | int rc, irq; |
409 | 409 | ||
410 | if (type == PCI_CAP_ID_MSI && nvec > 1) | 410 | if (type == PCI_CAP_ID_MSI && nvec > 1) |
411 | return 1; | 411 | return 1; |
@@ -433,7 +433,7 @@ int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | |||
433 | list_for_each_entry(msi, &pdev->msi_list, list) { | 433 | list_for_each_entry(msi, &pdev->msi_list, list) { |
434 | rc = -EIO; | 434 | rc = -EIO; |
435 | irq = irq_alloc_desc(0); /* Alloc irq on node 0 */ | 435 | irq = irq_alloc_desc(0); /* Alloc irq on node 0 */ |
436 | if (irq == NO_IRQ) | 436 | if (irq < 0) |
437 | goto out_msi; | 437 | goto out_msi; |
438 | rc = irq_set_msi_desc(irq, msi); | 438 | rc = irq_set_msi_desc(irq, msi); |
439 | if (rc) | 439 | if (rc) |