PCI/MSI: Return failure when msix_setup_entries() fails
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 27 Jan 2017 15:14:53 +0000 (16:14 +0100)
committerBjorn Helgaas <helgaas@kernel.org>
Fri, 10 Feb 2017 20:10:24 +0000 (14:10 -0600)
If alloc_msi_entry() fails, we free resources and set ret = -ENOMEM.

However, msix_setup_entries() returns 0 unconditionally.  Return the error
code instead.

Fixes: e75eafb9b039 ("genirq/msi: Switch to new irq spreading infrastructure")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/msi.c

index b6785c8..0f77b38 100644 (file)
@@ -731,7 +731,7 @@ static int msix_setup_entries(struct pci_dev *dev, void __iomem *base,
        ret = 0;
 out:
        kfree(masks);
-       return 0;
+       return ret;
 }
 
 static void msix_program_entries(struct pci_dev *dev,