aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/s2io.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2009-08-24 13:29:43 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-31 01:34:46 -0400
commit44364a035a4f7c5b58fd96b1a90b52746d1aab6b (patch)
treeeef3322eb8828d1bd67d48038f0c47a6d46503cf /drivers/net/s2io.c
parent4f87032021be1aa0c3bb66b0c89d30cb35b57f8f (diff)
s2io.c: use kzalloc
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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;