[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 05/31] Fix compile warning: ignoring return value of 'pci_bus_add_device', declared with attribute warn_unused_result



Make sure to check the return value and if it is a failure,
provide a descriptive message and quit.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 drivers/xen/pcifront/pci_op.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/pcifront/pci_op.c b/drivers/xen/pcifront/pci_op.c
index b239cf0..03ed1f9 100644
--- a/drivers/xen/pcifront/pci_op.c
+++ b/drivers/xen/pcifront/pci_op.c
@@ -497,6 +497,7 @@ int __devinit pcifront_rescan_root(struct pcifront_device 
*pdev,
        struct pci_bus *b;
        struct pci_dev *d;
        unsigned int devfn;
+       int err;
 
 #ifndef CONFIG_PCI_DOMAINS
        if (domain != 0) {
@@ -533,7 +534,13 @@ int __devinit pcifront_rescan_root(struct pcifront_device 
*pdev,
                        dev_info(&pdev->xdev->dev, "New device on "
                                 "%04x:%02x:%02x.%02x found.\n", domain, bus,
                                 PCI_SLOT(devfn), PCI_FUNC(devfn));
-                       pci_bus_add_device(d);
+                       err = pci_bus_add_device(d);
+                       if (err) {
+                               dev_err(&pdev->xdev->dev, "Failed to add "
+                               " device to bus.\n");
+                               return err;
+                       }
+                       
                }
        }
 
-- 
1.6.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.