aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChaehyun Lim <chaehyun.lim@gmail.com>2015-09-22 22:47:39 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-29 02:32:36 +0200
commitef154414b2e7ba2e20db932fc96262cc692e8621 (patch)
tree9abcfda6bcccec6d6ed895a1f2e012dfd89c0470
parentstaging: wilc1000: rename SendConfigPkt (diff)
staging: wilc1000: replace kmalloc with kzalloc
This patch replaces kmalloc with kzalloc because it is initialized by 0 immediately after allcating memory. Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/wilc1000/coreconfigurator.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 381376758898..d8b8c3d86be0 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -439,12 +439,10 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
u32 u32Tsf_Lo;
u32 u32Tsf_Hi;
- pstrNetworkInfo = kmalloc(sizeof(tstrNetworkInfo), GFP_KERNEL);
+ pstrNetworkInfo = kzalloc(sizeof(tstrNetworkInfo), GFP_KERNEL);
if (!pstrNetworkInfo)
return -ENOMEM;
- memset((void *)(pstrNetworkInfo), 0, sizeof(tstrNetworkInfo));
-
pstrNetworkInfo->s8rssi = pu8WidVal[0];
/* Assign a pointer to msa "Mac Header Start Address" */
@@ -559,12 +557,10 @@ s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen,
u8 *pu8IEs = NULL;
u16 u16IEsLen = 0;
- pstrConnectRespInfo = kmalloc(sizeof(tstrConnectRespInfo), GFP_KERNEL);
+ pstrConnectRespInfo = kzalloc(sizeof(tstrConnectRespInfo), GFP_KERNEL);
if (!pstrConnectRespInfo)
return -ENOMEM;
- memset((void *)(pstrConnectRespInfo), 0, sizeof(tstrConnectRespInfo));
-
/* u16AssocRespLen = pu8Buffer[0]; */
u16AssocRespLen = (u16)u32BufferLen;