lkml.org 
[lkml]   [2009]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/8] staging: agnx, fix fail paths in probe
Date
Return error on fail paths instead of 0.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
drivers/staging/agnx/pci.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/agnx/pci.c b/drivers/staging/agnx/pci.c
index f2fbd26..d8aee7d 100644
--- a/drivers/staging/agnx/pci.c
+++ b/drivers/staging/agnx/pci.c
@@ -470,6 +470,7 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev,
if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) ||
pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK)) {
dev_err(&pdev->dev, "no suitable DMA available\n");
+ err = -EIO;
goto err_free_reg;
}

@@ -493,11 +494,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;
}

--
1.6.2


\
 
 \ /
  Last update: 2009-03-26 09:41    [W:0.046 / U:0.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site