diff options
author | Holger Schurig <hs4233@mail.mn-solutions.de> | 2007-05-25 11:58:22 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-06-11 14:28:38 -0400 |
commit | fb3dddf22c63d7e0622d4819a87dbb8563f0e968 (patch) | |
tree | c2f87ff85be78a8501189b8ac555f61eb44f262a /drivers/net/wireless/libertas/cmd.c | |
parent | 6df3073d2923c12b6f7524917a634e83de958dfe (diff) |
[PATCH] libertas: changed some occurences of kmalloc() + memset(&a,0,sz) to kzalloc()
The subject says it all.
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/cmd.c')
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 30f1d41a16d..c1d9902cac5 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c @@ -1482,28 +1482,24 @@ int libertas_allocate_cmd_buffer(wlan_private * priv) /* Allocate and initialize cmdCtrlNode */ ulbufsize = sizeof(struct cmd_ctrl_node) * MRVDRV_NUM_OF_CMD_BUFFER; - if (!(tempcmd_array = kmalloc(ulbufsize, GFP_KERNEL))) { + if (!(tempcmd_array = kzalloc(ulbufsize, GFP_KERNEL))) { lbs_deb_cmd( "ALLOC_CMD_BUF: failed to allocate tempcmd_array\n"); ret = -1; goto done; } - adapter->cmd_array = tempcmd_array; - memset(adapter->cmd_array, 0, ulbufsize); /* Allocate and initialize command buffers */ ulbufsize = MRVDRV_SIZE_OF_CMD_BUFFER; for (i = 0; i < MRVDRV_NUM_OF_CMD_BUFFER; i++) { - if (!(ptempvirtualaddr = kmalloc(ulbufsize, GFP_KERNEL))) { + if (!(ptempvirtualaddr = kzalloc(ulbufsize, GFP_KERNEL))) { lbs_deb_cmd( "ALLOC_CMD_BUF: ptempvirtualaddr: out of memory\n"); ret = -1; goto done; } - memset(ptempvirtualaddr, 0, ulbufsize); - /* Update command buffer virtual */ tempcmd_array[i].bufvirtualaddr = ptempvirtualaddr; } |