From patchwork Mon Aug 17 02:05:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaehyun Lim X-Patchwork-Id: 7022821 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5E4DBC05AC for ; Mon, 17 Aug 2015 02:05:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 700922062E for ; Mon, 17 Aug 2015 02:05:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A2312062C for ; Mon, 17 Aug 2015 02:05:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753405AbbHQCFg (ORCPT ); Sun, 16 Aug 2015 22:05:36 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:33392 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753134AbbHQCFf (ORCPT ); Sun, 16 Aug 2015 22:05:35 -0400 Received: by pabyb7 with SMTP id yb7so97251098pab.0 for ; Sun, 16 Aug 2015 19:05:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iT93VWobYNrMwca8Uudz8O4g4nqDCSaJlPWq0mitme4=; b=YzxVRW5Miu6Rkb0Q6/LprK32MwgCR2FA9ODDs1e24NLZ4353YEbguXpuKd0xUU5zm9 cD7YaiacUuqLdWmNwoGMUGXxu/ss9ceV3zxTumAKucarYCVsQsrPM48C0kIuKGTv8lbr POkfH8i0AFlOVgCu0qk4GmCGmOxlQ/mIVZsLyjHocdzuvOWtkDndMEPsiDYOlXldwd/f Nks458YgIKPRi3s2AF5akX2RkcJ90keYRTohpU9f788hLHG3fGeVioI33VI/EsPX92st zmCEJjgl1JgabdTiGMoAR3320QSp/gel1zcQ9Vg4DXA4HKWsbh/Oa4EwGW13g/uv9oYN /oeQ== X-Received: by 10.68.117.142 with SMTP id ke14mr113407626pbb.93.1439777134825; Sun, 16 Aug 2015 19:05:34 -0700 (PDT) Received: from localhost.localdomain ([218.233.16.2]) by smtp.gmail.com with ESMTPSA id tt8sm12609611pbc.49.2015.08.16.19.05.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 16 Aug 2015 19:05:34 -0700 (PDT) From: Chaehyun Lim To: gregkh@linuxfoundation.org Cc: johnny.kim@atmel.com, rachel.kim@atmel.com, dean.lee@atmel.com, chris.park@atmel.com, linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, Chaehyun Lim Subject: [PATCH 5/6] staging: wilc1000: coreconfigurator.c: use kmalloc instead of WILC_MALLOC Date: Mon, 17 Aug 2015 11:05:14 +0900 Message-Id: <1439777115-25861-5-git-send-email-chaehyun.lim@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439777115-25861-1-git-send-email-chaehyun.lim@gmail.com> References: <1439777115-25861-1-git-send-email-chaehyun.lim@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/staging/wilc1000/coreconfigurator.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 4a6b975..f44d2ce 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);