staging: agnx, fix fail paths in probe
authorJiri Slaby <jirislaby@gmail.com>
Thu, 26 Mar 2009 08:34:09 +0000 (09:34 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 19 Jun 2009 18:00:35 +0000 (11:00 -0700)
Return error on fail paths instead of 0.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/agnx/pci.c

index 3aef9aab47e5ed8fb7edebb7c7f2ba17aa7cc78b..e5bf9a2a76802439d2a14cd904179266fdf0c5c1 100644 (file)
@@ -473,6 +473,7 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev,
        if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) ||
            pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) {
                dev_err(&pdev->dev, "no suitable DMA available\n");
+               err = -EIO;
                goto err_free_reg;
        }
 
@@ -496,11 +497,13 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev,
 /*     dev_dbg(&pdev->dev, "MEM1 mapped address is 0x%p\n", priv->ctl); */
        if (!priv->ctl) {
                dev_err(&pdev->dev, "can't map device memory\n");
+               err = -ENOMEM;
                goto err_free_dev;
        }
        priv->data = pci_iomap(pdev, 1, 0);
        if (!priv->data) {
                dev_err(&pdev->dev, "can't map device memory\n");
+               err = -ENOMEM;
                goto err_iounmap2;
        }