aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/s2io.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/s2io.c')
-rw-r--r--drivers/net/s2io.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 75f2209bc013..134cdb39e701 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -3834,7 +3834,7 @@ static int s2io_enable_msi_x(struct s2io_nic *nic)
3834 int size; 3834 int size;
3835 3835
3836 size = nic->num_entries * sizeof(struct msix_entry); 3836 size = nic->num_entries * sizeof(struct msix_entry);
3837 nic->entries = kmalloc(size, GFP_KERNEL); 3837 nic->entries = kzalloc(size, GFP_KERNEL);
3838 if (!nic->entries) { 3838 if (!nic->entries) {
3839 DBG_PRINT(INFO_DBG, "%s: Memory allocation failed\n", \ 3839 DBG_PRINT(INFO_DBG, "%s: Memory allocation failed\n", \
3840 __func__); 3840 __func__);
@@ -3843,10 +3843,8 @@ static int s2io_enable_msi_x(struct s2io_nic *nic)
3843 } 3843 }
3844 nic->mac_control.stats_info->sw_stat.mem_allocated += size; 3844 nic->mac_control.stats_info->sw_stat.mem_allocated += size;
3845 3845
3846 memset(nic->entries, 0, size);
3847
3848 size = nic->num_entries * sizeof(struct s2io_msix_entry); 3846 size = nic->num_entries * sizeof(struct s2io_msix_entry);
3849 nic->s2io_entries = kmalloc(size, GFP_KERNEL); 3847 nic->s2io_entries = kzalloc(size, GFP_KERNEL);
3850 if (!nic->s2io_entries) { 3848 if (!nic->s2io_entries) {
3851 DBG_PRINT(INFO_DBG, "%s: Memory allocation failed\n", 3849 DBG_PRINT(INFO_DBG, "%s: Memory allocation failed\n",
3852 __func__); 3850 __func__);
@@ -3857,7 +3855,6 @@ static int s2io_enable_msi_x(struct s2io_nic *nic)
3857 return -ENOMEM; 3855 return -ENOMEM;
3858 } 3856 }
3859 nic->mac_control.stats_info->sw_stat.mem_allocated += size; 3857 nic->mac_control.stats_info->sw_stat.mem_allocated += size;
3860 memset(nic->s2io_entries, 0, size);
3861 3858
3862 nic->entries[0].entry = 0; 3859 nic->entries[0].entry = 0;
3863 nic->s2io_entries[0].entry = 0; 3860 nic->s2io_entries[0].entry = 0;