summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c')
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 1b5f7d57b6f8..2d38d1ac2aae 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -916,8 +916,9 @@ int qlcnic_82xx_mq_intrpt(struct qlcnic_adapter *adapter, int op_type)
if (qlcnic_check_multi_tx(adapter) &&
!ahw->diag_test &&
(adapter->flags & QLCNIC_MSIX_ENABLED)) {
- ahw->intr_tbl = vzalloc(ahw->num_msix *
- sizeof(struct qlcnic_intrpt_config));
+ ahw->intr_tbl =
+ vzalloc(array_size(sizeof(struct qlcnic_intrpt_config),
+ ahw->num_msix));
if (!ahw->intr_tbl)
return -ENOMEM;
@@ -1025,15 +1026,17 @@ int qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
act_pci_func = ahw->total_nic_func;
- adapter->npars = kzalloc(sizeof(struct qlcnic_npar_info) *
- act_pci_func, GFP_KERNEL);
+ adapter->npars = kcalloc(act_pci_func,
+ sizeof(struct qlcnic_npar_info),
+ GFP_KERNEL);
if (!adapter->npars) {
ret = -ENOMEM;
goto err_pci_info;
}
- adapter->eswitch = kzalloc(sizeof(struct qlcnic_eswitch) *
- QLCNIC_NIU_MAX_XG_PORTS, GFP_KERNEL);
+ adapter->eswitch = kcalloc(QLCNIC_NIU_MAX_XG_PORTS,
+ sizeof(struct qlcnic_eswitch),
+ GFP_KERNEL);
if (!adapter->eswitch) {
ret = -ENOMEM;
goto err_npars;