From: Konrad Rzeszutek Wilk Subject: [PATCH 05/31] Fix compile warning: ignoring return value of 'pci_bus_add_device', declared with attribute warn_unused_result Date: Thu, 5 Nov 2009 16:33:13 -0500 Message-ID: <1257456819-782-6-git-send-email-konrad.wilk@oracle.com> References: <1257456819-782-1-git-send-email-konrad.wilk@oracle.com> <1257456819-782-2-git-send-email-konrad.wilk@oracle.com> <1257456819-782-3-git-send-email-konrad.wilk@oracle.com> <1257456819-782-4-git-send-email-konrad.wilk@oracle.com> <1257456819-782-5-git-send-email-konrad.wilk@oracle.com> Return-path: In-Reply-To: <1257456819-782-5-git-send-email-konrad.wilk@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Jeremy Fitzhardinge , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org 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 --- 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