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>
This commit is contained in:
parent
3670802223
commit
0a0a942190
@ -401,11 +401,11 @@ static void zpci_irq_handler(struct airq_struct *airq)
|
|||||||
int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
|
int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
|
||||||
{
|
{
|
||||||
struct zpci_dev *zdev = get_zdev(pdev);
|
struct zpci_dev *zdev = get_zdev(pdev);
|
||||||
unsigned int hwirq, irq, msi_vecs;
|
unsigned int hwirq, msi_vecs;
|
||||||
unsigned long aisb;
|
unsigned long aisb;
|
||||||
struct msi_desc *msi;
|
struct msi_desc *msi;
|
||||||
struct msi_msg msg;
|
struct msi_msg msg;
|
||||||
int rc;
|
int rc, irq;
|
||||||
|
|
||||||
if (type == PCI_CAP_ID_MSI && nvec > 1)
|
if (type == PCI_CAP_ID_MSI && nvec > 1)
|
||||||
return 1;
|
return 1;
|
||||||
@ -433,7 +433,7 @@ int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
|
|||||||
list_for_each_entry(msi, &pdev->msi_list, list) {
|
list_for_each_entry(msi, &pdev->msi_list, list) {
|
||||||
rc = -EIO;
|
rc = -EIO;
|
||||||
irq = irq_alloc_desc(0); /* Alloc irq on node 0 */
|
irq = irq_alloc_desc(0); /* Alloc irq on node 0 */
|
||||||
if (irq == NO_IRQ)
|
if (irq < 0)
|
||||||
goto out_msi;
|
goto out_msi;
|
||||||
rc = irq_set_msi_desc(irq, msi);
|
rc = irq_set_msi_desc(irq, msi);
|
||||||
if (rc)
|
if (rc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user