PCI/MSI: Return failure when msix_setup_entries() fails
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 7 Oct 2017 22:36:49 +0000 (22:36 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Nov 2017 09:08:34 +0000 (10:08 +0100)
[ Upstream commit 3adfb572f2978a980b250a9e1a56f84f3a031001 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/msi.c

index 3455f75..0e9a9db 100644 (file)
@@ -730,7 +730,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,