aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorroel kluin <roel.kluin@gmail.com>2009-04-23 04:53:20 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-27 06:20:17 -0400
commit15b8e19131486856373592e45793a79aefb6fbe7 (patch)
treee833a48bf5da7b2fdecb5894fd5dcfa7935b54a4 /drivers/net
parent683703a26e4677db437a1480682851e27c7a154f (diff)
pasemi_mac: mac_to_intf() error not noticed
mac_to_intf() can return -1 when no device or function is found, but when mac->dma_if is unsigned. The error wasn't noticed. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/pasemi_mac.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index 6ea4539085d..c254a7f5b9f 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -1733,7 +1733,7 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1733{ 1733{
1734 struct net_device *dev; 1734 struct net_device *dev;
1735 struct pasemi_mac *mac; 1735 struct pasemi_mac *mac;
1736 int err; 1736 int err, ret;
1737 1737
1738 err = pci_enable_device(pdev); 1738 err = pci_enable_device(pdev);
1739 if (err) 1739 if (err)
@@ -1791,12 +1791,13 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1791 } 1791 }
1792 memcpy(dev->dev_addr, mac->mac_addr, sizeof(mac->mac_addr)); 1792 memcpy(dev->dev_addr, mac->mac_addr, sizeof(mac->mac_addr));
1793 1793
1794 mac->dma_if = mac_to_intf(mac); 1794 ret = mac_to_intf(mac);
1795 if (mac->dma_if < 0) { 1795 if (ret < 0) {
1796 dev_err(&mac->pdev->dev, "Can't map DMA interface\n"); 1796 dev_err(&mac->pdev->dev, "Can't map DMA interface\n");
1797 err = -ENODEV; 1797 err = -ENODEV;
1798 goto out; 1798 goto out;
1799 } 1799 }
1800 mac->dma_if = ret;
1800 1801
1801 switch (pdev->device) { 1802 switch (pdev->device) {
1802 case 0xa005: 1803 case 0xa005: