diff options
author | Don Fry <pcnet32@verizon.net> | 2009-07-31 04:40:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-02 15:23:05 -0400 |
commit | df4e7f72f5156ef16a918da8a575ba90ec27ab77 (patch) | |
tree | e1327cc5ae7c0f92ede1bc7c6a2c6e4d4d39ee2b /drivers/net | |
parent | a6ac65db2329e7685299666f5f7b6093c7b0f3a0 (diff) |
pcnet32: remove superfluous NULL pointer check in pcnet32_probe1()
Move the debug printk() into the proper place and remove superfluous
NULL pointer check in pcnet32_probe1().
This takes care of the following entry from Dan's list:
drivers/net/pcnet32.c +1889 pcnet32_probe1(298) warning: variable derefenced before check 'pdev'
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Don Fry <pcnet32@verizon.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/pcnet32.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index 1c35e1d637a0..b61c97254b3f 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c | |||
@@ -1611,8 +1611,11 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1611 | if (pcnet32_dwio_read_csr(ioaddr, 0) == 4 | 1611 | if (pcnet32_dwio_read_csr(ioaddr, 0) == 4 |
1612 | && pcnet32_dwio_check(ioaddr)) { | 1612 | && pcnet32_dwio_check(ioaddr)) { |
1613 | a = &pcnet32_dwio; | 1613 | a = &pcnet32_dwio; |
1614 | } else | 1614 | } else { |
1615 | if (pcnet32_debug & NETIF_MSG_PROBE) | ||
1616 | printk(KERN_ERR PFX "No access methods\n"); | ||
1615 | goto err_release_region; | 1617 | goto err_release_region; |
1618 | } | ||
1616 | } | 1619 | } |
1617 | 1620 | ||
1618 | chip_version = | 1621 | chip_version = |
@@ -1852,12 +1855,6 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1852 | ((cards_found >= MAX_UNITS) || full_duplex[cards_found])) | 1855 | ((cards_found >= MAX_UNITS) || full_duplex[cards_found])) |
1853 | lp->options |= PCNET32_PORT_FD; | 1856 | lp->options |= PCNET32_PORT_FD; |
1854 | 1857 | ||
1855 | if (!a) { | ||
1856 | if (pcnet32_debug & NETIF_MSG_PROBE) | ||
1857 | printk(KERN_ERR PFX "No access methods\n"); | ||
1858 | ret = -ENODEV; | ||
1859 | goto err_free_consistent; | ||
1860 | } | ||
1861 | lp->a = *a; | 1858 | lp->a = *a; |
1862 | 1859 | ||
1863 | /* prior to register_netdev, dev->name is not yet correct */ | 1860 | /* prior to register_netdev, dev->name is not yet correct */ |
@@ -1973,14 +1970,13 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
1973 | 1970 | ||
1974 | return 0; | 1971 | return 0; |
1975 | 1972 | ||
1976 | err_free_ring: | 1973 | err_free_ring: |
1977 | pcnet32_free_ring(dev); | 1974 | pcnet32_free_ring(dev); |
1978 | err_free_consistent: | ||
1979 | pci_free_consistent(lp->pci_dev, sizeof(*lp->init_block), | 1975 | pci_free_consistent(lp->pci_dev, sizeof(*lp->init_block), |
1980 | lp->init_block, lp->init_dma_addr); | 1976 | lp->init_block, lp->init_dma_addr); |
1981 | err_free_netdev: | 1977 | err_free_netdev: |
1982 | free_netdev(dev); | 1978 | free_netdev(dev); |
1983 | err_release_region: | 1979 | err_release_region: |
1984 | release_region(ioaddr, PCNET32_TOTAL_SIZE); | 1980 | release_region(ioaddr, PCNET32_TOTAL_SIZE); |
1985 | return ret; | 1981 | return ret; |
1986 | } | 1982 | } |