Skip to content

Commit

Permalink
s2io.c: use kzalloc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joe Perches authored and David S. Miller committed Aug 31, 2009
1 parent 4f87032 commit 44364a0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/net/s2io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3834,7 +3834,7 @@ static int s2io_enable_msi_x(struct s2io_nic *nic)
int size;

size = nic->num_entries * sizeof(struct msix_entry);
nic->entries = kmalloc(size, GFP_KERNEL);
nic->entries = kzalloc(size, GFP_KERNEL);
if (!nic->entries) {
DBG_PRINT(INFO_DBG, "%s: Memory allocation failed\n", \
__func__);
Expand All @@ -3843,10 +3843,8 @@ static int s2io_enable_msi_x(struct s2io_nic *nic)
}
nic->mac_control.stats_info->sw_stat.mem_allocated += size;

memset(nic->entries, 0, size);

size = nic->num_entries * sizeof(struct s2io_msix_entry);
nic->s2io_entries = kmalloc(size, GFP_KERNEL);
nic->s2io_entries = kzalloc(size, GFP_KERNEL);
if (!nic->s2io_entries) {
DBG_PRINT(INFO_DBG, "%s: Memory allocation failed\n",
__func__);
Expand All @@ -3857,7 +3855,6 @@ static int s2io_enable_msi_x(struct s2io_nic *nic)
return -ENOMEM;
}
nic->mac_control.stats_info->sw_stat.mem_allocated += size;
memset(nic->s2io_entries, 0, size);

nic->entries[0].entry = 0;
nic->s2io_entries[0].entry = 0;
Expand Down

0 comments on commit 44364a0

Please sign in to comment.