* [PATCH v2] Staging: wilc1000: Use kzalloc instead of kmalloc and memset
@ 2015-10-13 12:16 Shraddha Barke
2015-10-13 17:07 ` [Outreachy kernel] " Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Shraddha Barke @ 2015-10-13 12:16 UTC (permalink / raw)
To: outreachy-kernel
Replace kmalloc and memset with a single call to kzalloc.
Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
Changes in v2-
Based on the current staging-testing branch
drivers/staging/wilc1000/host_interface.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 9bc221c..c4316fc 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2445,15 +2445,13 @@ static int Handle_Key(struct host_if_drv *hif_drv,
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 |
@@ -2496,15 +2494,13 @@ static int Handle_Key(struct host_if_drv *hif_drv,
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 |
@@ -6582,9 +6578,8 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
pu8IEs = ptstrNetworkInfo->pu8IEs;
u16IEsLen = ptstrNetworkInfo->u16IEsLen;
- pNewJoinBssParam = kmalloc(sizeof(struct join_bss_param), GFP_KERNEL);
+ pNewJoinBssParam = kzalloc(sizeof(struct join_bss_param), GFP_KERNEL);
if (pNewJoinBssParam != NULL) {
- memset(pNewJoinBssParam, 0, sizeof(struct join_bss_param));
pNewJoinBssParam->dtim_period = ptstrNetworkInfo->u8DtimPeriod;
pNewJoinBssParam->beacon_period = ptstrNetworkInfo->u16BeaconPeriod;
pNewJoinBssParam->cap_info = ptstrNetworkInfo->u16CapInfo;
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Outreachy kernel] [PATCH v2] Staging: wilc1000: Use kzalloc instead of kmalloc and memset
2015-10-13 12:16 [PATCH v2] Staging: wilc1000: Use kzalloc instead of kmalloc and memset Shraddha Barke
@ 2015-10-13 17:07 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2015-10-13 17:07 UTC (permalink / raw)
To: Shraddha Barke; +Cc: outreachy-kernel
On Tue, Oct 13, 2015 at 05:46:45PM +0530, Shraddha Barke wrote:
> Replace kmalloc and memset with a single call to kzalloc.
>
> Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
> ---
> Changes in v2-
> Based on the current staging-testing branch
Still doesn't apply :(
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-13 17:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-13 12:16 [PATCH v2] Staging: wilc1000: Use kzalloc instead of kmalloc and memset Shraddha Barke
2015-10-13 17:07 ` [Outreachy kernel] " Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.