s2io.c: use kzalloc
authorJoe Perches <joe@perches.com>
Mon, 24 Aug 2009 17:29:43 +0000 (17:29 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 31 Aug 2009 05:34:46 +0000 (22:34 -0700)
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>
drivers/net/s2io.c

index 75f2209bc0137c01a9bb27ede1e226c964e022f3..134cdb39e701f216d8b3c90649bedd154e3299b5 100644 (file)
@@ -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__);
@@ -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__);
@@ -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;