diff options
author | roel kluin <roel.kluin@gmail.com> | 2009-04-23 10:53:20 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-27 12:20:17 +0200 |
commit | 15b8e19131486856373592e45793a79aefb6fbe7 (patch) | |
tree | e833a48bf5da7b2fdecb5894fd5dcfa7935b54a4 /drivers/net/pasemi_mac.c | |
parent | drop_monitor: Update netlink protocol to include netlink attribute header in ... (diff) | |
download | linux-15b8e19131486856373592e45793a79aefb6fbe7.tar.xz linux-15b8e19131486856373592e45793a79aefb6fbe7.zip |
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/pasemi_mac.c')
-rw-r--r-- | drivers/net/pasemi_mac.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index 6ea4539085d5..c254a7f5b9f5 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) { struct net_device *dev; struct pasemi_mac *mac; - int err; + int err, ret; err = pci_enable_device(pdev); if (err) @@ -1791,12 +1791,13 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } memcpy(dev->dev_addr, mac->mac_addr, sizeof(mac->mac_addr)); - mac->dma_if = mac_to_intf(mac); - if (mac->dma_if < 0) { + ret = mac_to_intf(mac); + if (ret < 0) { dev_err(&mac->pdev->dev, "Can't map DMA interface\n"); err = -ENODEV; goto out; } + mac->dma_if = ret; switch (pdev->device) { case 0xa005: |