diff options
author | David S. Miller <davem@davemloft.net> | 2008-10-31 03:17:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-31 03:17:34 -0400 |
commit | a1744d3bee19d3b9cbfb825ab316a101b9c9f109 (patch) | |
tree | c0e2324c09beca0eb5782eb5abf241ea2b7a4a11 /drivers/net/tulip/dmfe.c | |
parent | 275f165fa970174f8a98205529750e8abb6c0a33 (diff) | |
parent | a432226614c5616e3cfd211e0acffa0acfb4770c (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/p54/p54common.c
Diffstat (limited to 'drivers/net/tulip/dmfe.c')
-rw-r--r-- | drivers/net/tulip/dmfe.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index 194f1825718a..0ec3281529f9 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c | |||
@@ -419,9 +419,13 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
419 | /* Allocate Tx/Rx descriptor memory */ | 419 | /* Allocate Tx/Rx descriptor memory */ |
420 | db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) * | 420 | db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) * |
421 | DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr); | 421 | DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr); |
422 | if (!db->desc_pool_ptr) | ||
423 | goto err_out_res; | ||
422 | 424 | ||
423 | db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC * | 425 | db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC * |
424 | TX_DESC_CNT + 4, &db->buf_pool_dma_ptr); | 426 | TX_DESC_CNT + 4, &db->buf_pool_dma_ptr); |
427 | if (!db->buf_pool_ptr) | ||
428 | goto err_out_free_desc; | ||
425 | 429 | ||
426 | db->first_tx_desc = (struct tx_desc *) db->desc_pool_ptr; | 430 | db->first_tx_desc = (struct tx_desc *) db->desc_pool_ptr; |
427 | db->first_tx_desc_dma = db->desc_pool_dma_ptr; | 431 | db->first_tx_desc_dma = db->desc_pool_dma_ptr; |
@@ -468,7 +472,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
468 | 472 | ||
469 | err = register_netdev (dev); | 473 | err = register_netdev (dev); |
470 | if (err) | 474 | if (err) |
471 | goto err_out_res; | 475 | goto err_out_free_buf; |
472 | 476 | ||
473 | printk(KERN_INFO "%s: Davicom DM%04lx at pci%s, %pM, irq %d.\n", | 477 | printk(KERN_INFO "%s: Davicom DM%04lx at pci%s, %pM, irq %d.\n", |
474 | dev->name, | 478 | dev->name, |
@@ -481,6 +485,12 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
481 | 485 | ||
482 | return 0; | 486 | return 0; |
483 | 487 | ||
488 | err_out_free_buf: | ||
489 | pci_free_consistent(pdev, TX_BUF_ALLOC * TX_DESC_CNT + 4, | ||
490 | db->buf_pool_ptr, db->buf_pool_dma_ptr); | ||
491 | err_out_free_desc: | ||
492 | pci_free_consistent(pdev, sizeof(struct tx_desc) * DESC_ALL_CNT + 0x20, | ||
493 | db->desc_pool_ptr, db->desc_pool_dma_ptr); | ||
484 | err_out_res: | 494 | err_out_res: |
485 | pci_release_regions(pdev); | 495 | pci_release_regions(pdev); |
486 | err_out_disable: | 496 | err_out_disable: |