aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 0a5b770cefaa..c5fe915870ad 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -13941,14 +13941,14 @@ static int bnx2x_init_one(struct pci_dev *pdev,
13941 bp->doorbells = bnx2x_vf_doorbells(bp); 13941 bp->doorbells = bnx2x_vf_doorbells(bp);
13942 rc = bnx2x_vf_pci_alloc(bp); 13942 rc = bnx2x_vf_pci_alloc(bp);
13943 if (rc) 13943 if (rc)
13944 goto init_one_exit; 13944 goto init_one_freemem;
13945 } else { 13945 } else {
13946 doorbell_size = BNX2X_L2_MAX_CID(bp) * (1 << BNX2X_DB_SHIFT); 13946 doorbell_size = BNX2X_L2_MAX_CID(bp) * (1 << BNX2X_DB_SHIFT);
13947 if (doorbell_size > pci_resource_len(pdev, 2)) { 13947 if (doorbell_size > pci_resource_len(pdev, 2)) {
13948 dev_err(&bp->pdev->dev, 13948 dev_err(&bp->pdev->dev,
13949 "Cannot map doorbells, bar size too small, aborting\n"); 13949 "Cannot map doorbells, bar size too small, aborting\n");
13950 rc = -ENOMEM; 13950 rc = -ENOMEM;
13951 goto init_one_exit; 13951 goto init_one_freemem;
13952 } 13952 }
13953 bp->doorbells = ioremap_nocache(pci_resource_start(pdev, 2), 13953 bp->doorbells = ioremap_nocache(pci_resource_start(pdev, 2),
13954 doorbell_size); 13954 doorbell_size);
@@ -13957,19 +13957,19 @@ static int bnx2x_init_one(struct pci_dev *pdev,
13957 dev_err(&bp->pdev->dev, 13957 dev_err(&bp->pdev->dev,
13958 "Cannot map doorbell space, aborting\n"); 13958 "Cannot map doorbell space, aborting\n");
13959 rc = -ENOMEM; 13959 rc = -ENOMEM;
13960 goto init_one_exit; 13960 goto init_one_freemem;
13961 } 13961 }
13962 13962
13963 if (IS_VF(bp)) { 13963 if (IS_VF(bp)) {
13964 rc = bnx2x_vfpf_acquire(bp, tx_count, rx_count); 13964 rc = bnx2x_vfpf_acquire(bp, tx_count, rx_count);
13965 if (rc) 13965 if (rc)
13966 goto init_one_exit; 13966 goto init_one_freemem;
13967 } 13967 }
13968 13968
13969 /* Enable SRIOV if capability found in configuration space */ 13969 /* Enable SRIOV if capability found in configuration space */
13970 rc = bnx2x_iov_init_one(bp, int_mode, BNX2X_MAX_NUM_OF_VFS); 13970 rc = bnx2x_iov_init_one(bp, int_mode, BNX2X_MAX_NUM_OF_VFS);
13971 if (rc) 13971 if (rc)
13972 goto init_one_exit; 13972 goto init_one_freemem;
13973 13973
13974 /* calc qm_cid_count */ 13974 /* calc qm_cid_count */
13975 bp->qm_cid_count = bnx2x_set_qm_cid_count(bp); 13975 bp->qm_cid_count = bnx2x_set_qm_cid_count(bp);
@@ -13988,7 +13988,7 @@ static int bnx2x_init_one(struct pci_dev *pdev,
13988 rc = bnx2x_set_int_mode(bp); 13988 rc = bnx2x_set_int_mode(bp);
13989 if (rc) { 13989 if (rc) {
13990 dev_err(&pdev->dev, "Cannot set interrupts\n"); 13990 dev_err(&pdev->dev, "Cannot set interrupts\n");
13991 goto init_one_exit; 13991 goto init_one_freemem;
13992 } 13992 }
13993 BNX2X_DEV_INFO("set interrupts successfully\n"); 13993 BNX2X_DEV_INFO("set interrupts successfully\n");
13994 13994
@@ -13996,7 +13996,7 @@ static int bnx2x_init_one(struct pci_dev *pdev,
13996 rc = register_netdev(dev); 13996 rc = register_netdev(dev);
13997 if (rc) { 13997 if (rc) {
13998 dev_err(&pdev->dev, "Cannot register net device\n"); 13998 dev_err(&pdev->dev, "Cannot register net device\n");
13999 goto init_one_exit; 13999 goto init_one_freemem;
14000 } 14000 }
14001 BNX2X_DEV_INFO("device name after netdev register %s\n", dev->name); 14001 BNX2X_DEV_INFO("device name after netdev register %s\n", dev->name);
14002 14002
@@ -14029,6 +14029,9 @@ static int bnx2x_init_one(struct pci_dev *pdev,
14029 14029
14030 return 0; 14030 return 0;
14031 14031
14032init_one_freemem:
14033 bnx2x_free_mem_bp(bp);
14034
14032init_one_exit: 14035init_one_exit:
14033 bnx2x_disable_pcie_error_reporting(bp); 14036 bnx2x_disable_pcie_error_reporting(bp);
14034 14037