From: Christophe JAILLET Date: Fri, 27 Jan 2017 15:14:53 +0000 (+0100) Subject: PCI/MSI: Return failure when msix_setup_entries() fails X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=3adfb572f2978a980b250a9e1a56f84f3a031001;p=openwrt%2Fstaging%2Fblogic.git PCI/MSI: Return failure when msix_setup_entries() fails 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 Signed-off-by: Bjorn Helgaas --- diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index b6785c8be44d..0f77b38f03dd 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -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,