diff options
author | Chaehyun Lim <chaehyun.lim@gmail.com> | 2015-08-17 05:05:14 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-08-17 22:50:02 +0300 |
commit | 0ac87998784e261e1080907da912afb562737c69 (patch) | |
tree | dd3980786ab90b058f3e7e3472c32b084c106497 /drivers/staging | |
parent | 280f1fa0808ea6e3b6bd5b39d67a0bb0a35a6761 (diff) | |
download | linux-0ac87998784e261e1080907da912afb562737c69.tar.xz |
staging: wilc1000: coreconfigurator.c: use kmalloc instead of WILC_MALLOC
The kmalloc is used to handle host interface message within kernel thread.
The manipulation of host interface message is not called on IRQ context
and I could not find any spinlock inside function.
Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/wilc1000/coreconfigurator.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 20044872ee74..fd899140b16f 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -800,7 +800,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo) u32 u32Tsf_Lo; u32 u32Tsf_Hi; - pstrNetworkInfo = WILC_MALLOC(sizeof(tstrNetworkInfo)); + pstrNetworkInfo = kmalloc(sizeof(tstrNetworkInfo), GFP_KERNEL); memset((void *)(pstrNetworkInfo), 0, sizeof(tstrNetworkInfo)); pstrNetworkInfo->s8rssi = pu8WidVal[0]; @@ -850,7 +850,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo) u16IEsLen = u16RxLen - (MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN); if (u16IEsLen > 0) { - pstrNetworkInfo->pu8IEs = WILC_MALLOC(u16IEsLen); + pstrNetworkInfo->pu8IEs = kmalloc(u16IEsLen, GFP_KERNEL); memset((void *)(pstrNetworkInfo->pu8IEs), 0, u16IEsLen); memcpy(pstrNetworkInfo->pu8IEs, pu8IEs, u16IEsLen); @@ -917,7 +917,7 @@ s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen, u8 *pu8IEs = 0; u16 u16IEsLen = 0; - pstrConnectRespInfo = WILC_MALLOC(sizeof(tstrConnectRespInfo)); + pstrConnectRespInfo = kmalloc(sizeof(tstrConnectRespInfo), GFP_KERNEL); memset((void *)(pstrConnectRespInfo), 0, sizeof(tstrConnectRespInfo)); /* u16AssocRespLen = pu8Buffer[0]; */ @@ -937,7 +937,7 @@ s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen, pu8IEs = &pu8Buffer[CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN]; u16IEsLen = u16AssocRespLen - (CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN); - pstrConnectRespInfo->pu8RespIEs = WILC_MALLOC(u16IEsLen); + pstrConnectRespInfo->pu8RespIEs = kmalloc(u16IEsLen, GFP_KERNEL); memset((void *)(pstrConnectRespInfo->pu8RespIEs), 0, u16IEsLen); memcpy(pstrConnectRespInfo->pu8RespIEs, pu8IEs, u16IEsLen); @@ -1006,7 +1006,8 @@ s32 ParseSurveyResults(u8 ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZ } } - pstrSurveyResults = WILC_MALLOC(u32SurveyResultsCount * sizeof(wid_site_survey_reslts_s)); + pstrSurveyResults = kmalloc_array(u32SurveyResultsCount, + sizeof(wid_site_survey_reslts_s), GFP_KERNEL); if (pstrSurveyResults == NULL) { u32SurveyResultsCount = 0; WILC_ERRORREPORT(s32Error, WILC_NO_MEM); |