diff options
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index b0bc5ffee903..29a1c03b558e 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |||
@@ -2091,7 +2091,7 @@ static int __bnx2fc_enable(struct fcoe_ctlr *ctlr) | |||
2091 | { | 2091 | { |
2092 | struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); | 2092 | struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr); |
2093 | struct bnx2fc_hba *hba; | 2093 | struct bnx2fc_hba *hba; |
2094 | struct cnic_fc_npiv_tbl npiv_tbl; | 2094 | struct cnic_fc_npiv_tbl *npiv_tbl; |
2095 | struct fc_lport *lport; | 2095 | struct fc_lport *lport; |
2096 | 2096 | ||
2097 | if (interface->enabled == false) { | 2097 | if (interface->enabled == false) { |
@@ -2123,11 +2123,16 @@ static int __bnx2fc_enable(struct fcoe_ctlr *ctlr) | |||
2123 | if (!hba->cnic->get_fc_npiv_tbl) | 2123 | if (!hba->cnic->get_fc_npiv_tbl) |
2124 | goto done; | 2124 | goto done; |
2125 | 2125 | ||
2126 | memset(&npiv_tbl, 0, sizeof(npiv_tbl)); | 2126 | npiv_tbl = kzalloc(sizeof(struct cnic_fc_npiv_tbl), GFP_KERNEL); |
2127 | if (hba->cnic->get_fc_npiv_tbl(hba->cnic, &npiv_tbl)) | 2127 | if (!npiv_tbl) |
2128 | goto done; | 2128 | goto done; |
2129 | 2129 | ||
2130 | bnx2fc_npiv_create_vports(lport, &npiv_tbl); | 2130 | if (hba->cnic->get_fc_npiv_tbl(hba->cnic, npiv_tbl)) |
2131 | goto done_free; | ||
2132 | |||
2133 | bnx2fc_npiv_create_vports(lport, npiv_tbl); | ||
2134 | done_free: | ||
2135 | kfree(npiv_tbl); | ||
2131 | done: | 2136 | done: |
2132 | return 0; | 2137 | return 0; |
2133 | } | 2138 | } |