Commit 8af6caf5 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

staging: agnx, fix fail paths in probe

Return error on fail paths instead of 0.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a505fe71
...@@ -473,6 +473,7 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev, ...@@ -473,6 +473,7 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev,
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) || if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) ||
pci_set_consistent_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"); dev_err(&pdev->dev, "no suitable DMA available\n");
err = -EIO;
goto err_free_reg; goto err_free_reg;
} }
...@@ -496,11 +497,13 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev, ...@@ -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); */ /* dev_dbg(&pdev->dev, "MEM1 mapped address is 0x%p\n", priv->ctl); */
if (!priv->ctl) { if (!priv->ctl) {
dev_err(&pdev->dev, "can't map device memory\n"); dev_err(&pdev->dev, "can't map device memory\n");
err = -ENOMEM;
goto err_free_dev; goto err_free_dev;
} }
priv->data = pci_iomap(pdev, 1, 0); priv->data = pci_iomap(pdev, 1, 0);
if (!priv->data) { if (!priv->data) {
dev_err(&pdev->dev, "can't map device memory\n"); dev_err(&pdev->dev, "can't map device memory\n");
err = -ENOMEM;
goto err_iounmap2; goto err_iounmap2;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment