linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Chaehyun Lim <chaehyun.lim@gmail.com>
Cc: rachel.kim@atmel.com, dean.lee@atmel.com, chris.park@atmel.com,
	devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org,
	johnny.kim@atmel.com
Subject: Re: [PATCH 1/3] staging: wilc1000: coreconfigurator.c: remove WILC_MALLOC
Date: Thu, 23 Jul 2015 14:52:14 -0700	[thread overview]
Message-ID: <20150723215214.GA32146@kroah.com> (raw)
In-Reply-To: <1437650359-2051-1-git-send-email-chaehyun.lim@gmail.com>

On Thu, Jul 23, 2015 at 08:19:17PM +0900, Chaehyun Lim wrote:
> Use kmalloc and kmalloc_array instead of WILC_MALLOC.
> 
> Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
> ---
>  drivers/staging/wilc1000/coreconfigurator.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
> index b069614..7e2b2ab41 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.c
> +++ b/drivers/staging/wilc1000/coreconfigurator.c
> @@ -674,7 +674,7 @@ s32 CoreConfiguratorInit(void)
>  	sema_init(&SemHandleSendPkt, 1);
>  	sema_init(&SemHandlePktResp, 0);
>  
> -	gps8ConfigPacket = (s8 *)WILC_MALLOC(MAX_PACKET_BUFF_SIZE);
> +	gps8ConfigPacket = kmalloc(MAX_PACKET_BUFF_SIZE, GFP_ATOMIC);

I know this is what WILC_MALLOC() did, but should this really be
GFP_ATOMIC?

>  	if (gps8ConfigPacket == NULL) {
>  		PRINT_ER("failed in gps8ConfigPacket allocation\n");
>  		s32Error = WILC_NO_MEM;
> @@ -811,7 +811,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
>  		u32 u32Tsf_Lo;
>  		u32 u32Tsf_Hi;
>  
> -		pstrNetworkInfo = (tstrNetworkInfo *)WILC_MALLOC(sizeof(tstrNetworkInfo));
> +		pstrNetworkInfo = kmalloc(sizeof(tstrNetworkInfo), GFP_ATOMIC);

Same here.  And everywhere else you changed this code, please review and
resend.

thanks,

greg k-h

      parent reply	other threads:[~2015-07-23 21:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-23 11:19 [PATCH 1/3] staging: wilc1000: coreconfigurator.c: remove WILC_MALLOC Chaehyun Lim
2015-07-23 11:19 ` [PATCH 2/3] staging: wilc1000: coreconfigurator.c: add kmalloc error check Chaehyun Lim
2015-07-23 11:31   ` Dan Carpenter
2015-07-23 17:19   ` Joe Perches
2015-07-23 11:19 ` [PATCH 3/3] staging: wilc1000: coreconfigurator.c: fix " Chaehyun Lim
2015-07-23 21:52 ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150723215214.GA32146@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=chaehyun.lim@gmail.com \
    --cc=chris.park@atmel.com \
    --cc=dean.lee@atmel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=johnny.kim@atmel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rachel.kim@atmel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).