Staging: wilc1000: Use kzalloc instead of kmalloc and memset
PATCH 1/1 Staging: wilc1000: Use kzalloc instead of kmalloc and memset
Replace kmalloc and memset with a single call to kzalloc.
Signed-off-by Shraddha Barke <[email protected]>
--- drivers/staging/wilc1000/host_interface.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/staging/wilc1000/host_interface.c +3 -8
@@ -2523,15 +2523,13 @@ static int Handle_Key(tstrWILC_WFIDrv *drvHandler,case WPARxGtk:if (pstrHostIFkeyAttr->u8KeyAction &ADDKEY_AP ) { - pu8keybuf =kmalloc (RX_MIC_KEY_MSG_LEN ,GFP_KERNEL ); + pu8keybuf =kzalloc (RX_MIC_KEY_MSG_LEN ,GFP_KERNEL );if (pu8keybuf ==NULL ) {PRINT_ER ("No buffer to send RxGTK Key\n" ); ret =-1 ; goto _WPARxGtk_end_case_; } -memset (pu8keybuf,0 ,RX_MIC_KEY_MSG_LEN ); -/*|----------------------------------------------------------------------------| * |Sta Address | Key RSC | KeyID | Key Length | Temporal Key | Rx Michael Key |
@@ -2574,15 +2572,13 @@ static int Handle_Key(tstrWILC_WFIDrv *drvHandler,if (pstrHostIFkeyAttr->u8KeyAction &ADDKEY ) {PRINT_D (HOSTINF_DBG ,"Handling group key(Rx) function\n" ); - pu8keybuf =kmalloc (RX_MIC_KEY_MSG_LEN ,GFP_KERNEL ); + pu8keybuf =kzalloc (RX_MIC_KEY_MSG_LEN ,GFP_KERNEL );if (pu8keybuf ==NULL ) {PRINT_ER ("No buffer to send RxGTK Key\n" ); ret =-1 ; goto _WPARxGtk_end_case_; } -memset (pu8keybuf,0 ,RX_MIC_KEY_MSG_LEN ); -/*|----------------------------------------------------------------------------| * |Sta Address | Key RSC | KeyID | Key Length | Temporal Key | Rx Michael Key |
@@ -6750,9 +6746,8 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo) pu8IEs = ptstrNetworkInfo->pu8IEs; u16IEsLen = ptstrNetworkInfo->u16IEsLen; - pNewJoinBssParam =kmalloc (sizeof (tstrJoinBssParam),GFP_KERNEL ); + pNewJoinBssParam =kzalloc (sizeof (tstrJoinBssParam),GFP_KERNEL );if (pNewJoinBssParam !=NULL ) { -memset (pNewJoinBssParam,0 ,sizeof (tstrJoinBssParam)); pNewJoinBssParam->dtim_period = ptstrNetworkInfo->u8DtimPeriod; pNewJoinBssParam->beacon_period = ptstrNetworkInfo->u16BeaconPeriod; pNewJoinBssParam->cap_info = ptstrNetworkInfo->u16CapInfo;
Signature · 1 line
2.1.4
Greg KH
maintainerQuoted 6 lines · Shraddha Barke
Replace kmalloc and memset with a single call to kzalloc.
Signed-off-by Shraddha Barke <[email protected]>--- drivers/staging/wilc1000/host_interface.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
This patch no longer applies to my staging-testing branch :(