All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Janani Ravichandran <janani.rvchndrn@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH v3] staging: rdma: Use kcalloc instead of kzalloc
Date: Tue, 9 Feb 2016 08:23:26 -0800	[thread overview]
Message-ID: <20160209162326.GC28133@kroah.com> (raw)
In-Reply-To: <20160209210029.GA8305@janani-Inspiron-3521>

On Tue, Feb 09, 2016 at 04:00:29PM -0500, Janani Ravichandran wrote:
> Use kcalloc rather than kzalloc when multiplied with size to prevent
> integer overflows. This change also makes code nicer to read.

But that's not what this patch does:

> 
> Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
> ---
> Changes since v2:
>  * Moved GFP_KERNEL to the previous line as it fits there.
> 
>  drivers/staging/rdma/hfi1/efivar.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rdma/hfi1/efivar.c b/drivers/staging/rdma/hfi1/efivar.c
> index b8711f3..e569f9f 100644
> --- a/drivers/staging/rdma/hfi1/efivar.c
> +++ b/drivers/staging/rdma/hfi1/efivar.c
> @@ -83,8 +83,7 @@ static int read_efi_var(const char *name, unsigned long *size,
>  	if (!efi_enabled(EFI_RUNTIME_SERVICES))
>  		return -EOPNOTSUPP;
>  
> -	uni_name = kcalloc(strlen(name) + 1, sizeof(efi_char16_t),
> -			   GFP_KERNEL);
> +	uni_name = kcalloc(strlen(name) + 1, sizeof(efi_char16_t), GFP_KERNEL);

You aren't calling kzalloc :(

Did you make this patch on top of something else accidentally?

thanks,

greg k-h


  parent reply	other threads:[~2016-02-09 16:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09 21:00 [PATCH v3] staging: rdma: Use kcalloc instead of kzalloc Janani Ravichandran
2016-02-09 16:05 ` [Outreachy kernel] " Julia Lawall
2016-02-09 16:23 ` Greg KH [this message]
2016-02-09 16:34   ` Janani Ravichandran

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=20160209162326.GC28133@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=janani.rvchndrn@gmail.com \
    --cc=outreachy-kernel@googlegroups.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 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.