aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/cmd.c
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2007-05-25 11:58:22 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-06-11 14:28:38 -0400
commitfb3dddf22c63d7e0622d4819a87dbb8563f0e968 (patch)
treec2f87ff85be78a8501189b8ac555f61eb44f262a /drivers/net/wireless/libertas/cmd.c
parent6df3073d2923c12b6f7524917a634e83de958dfe (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.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 30f1d41a16d7..c1d9902cac5d 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)
1482 /* Allocate and initialize cmdCtrlNode */ 1482 /* Allocate and initialize cmdCtrlNode */
1483 ulbufsize = sizeof(struct cmd_ctrl_node) * MRVDRV_NUM_OF_CMD_BUFFER; 1483 ulbufsize = sizeof(struct cmd_ctrl_node) * MRVDRV_NUM_OF_CMD_BUFFER;
1484 1484
1485 if (!(tempcmd_array = kmalloc(ulbufsize, GFP_KERNEL))) { 1485 if (!(tempcmd_array = kzalloc(ulbufsize, GFP_KERNEL))) {
1486 lbs_deb_cmd( 1486 lbs_deb_cmd(
1487 "ALLOC_CMD_BUF: failed to allocate tempcmd_array\n"); 1487 "ALLOC_CMD_BUF: failed to allocate tempcmd_array\n");
1488 ret = -1; 1488 ret = -1;
1489 goto done; 1489 goto done;
1490 } 1490 }
1491
1492 adapter->cmd_array = tempcmd_array; 1491 adapter->cmd_array = tempcmd_array;
1493 memset(adapter->cmd_array, 0, ulbufsize);
1494 1492
1495 /* Allocate and initialize command buffers */ 1493 /* Allocate and initialize command buffers */
1496 ulbufsize = MRVDRV_SIZE_OF_CMD_BUFFER; 1494 ulbufsize = MRVDRV_SIZE_OF_CMD_BUFFER;
1497 for (i = 0; i < MRVDRV_NUM_OF_CMD_BUFFER; i++) { 1495 for (i = 0; i < MRVDRV_NUM_OF_CMD_BUFFER; i++) {
1498 if (!(ptempvirtualaddr = kmalloc(ulbufsize, GFP_KERNEL))) { 1496 if (!(ptempvirtualaddr = kzalloc(ulbufsize, GFP_KERNEL))) {
1499 lbs_deb_cmd( 1497 lbs_deb_cmd(
1500 "ALLOC_CMD_BUF: ptempvirtualaddr: out of memory\n"); 1498 "ALLOC_CMD_BUF: ptempvirtualaddr: out of memory\n");
1501 ret = -1; 1499 ret = -1;
1502 goto done; 1500 goto done;
1503 } 1501 }
1504 1502
1505 memset(ptempvirtualaddr, 0, ulbufsize);
1506
1507 /* Update command buffer virtual */ 1503 /* Update command buffer virtual */
1508 tempcmd_array[i].bufvirtualaddr = ptempvirtualaddr; 1504 tempcmd_array[i].bufvirtualaddr = ptempvirtualaddr;
1509 } 1505 }