mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Fabian Frederick <fabf@skynet.be>
Cc: linux-kernel@vger.kernel.org,
	Phillip Lougher <phillip@squashfs.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/1] fs/squashfs/file_direct.c: replace count*size kmalloc by kcalloc
Date: Mon, 16 Jun 2014 11:37:46 -0700	[thread overview]
Message-ID: <1402943866.3182.4.camel@joe-AO725> (raw)
In-Reply-To: <1402942339-8993-1-git-send-email-fabf@skynet.be>

On Mon, 2014-06-16 at 20:12 +0200, Fabian Frederick wrote:
> kcalloc manages count*sizeof overflow.

so does kmalloc_array

> diff --git a/fs/squashfs/file_direct.c b/fs/squashfs/file_direct.c
[]
> -	page = kmalloc(sizeof(void *) * pages, GFP_KERNEL);
> +	page = kcalloc(pages, sizeof(void *), GFP_KERNEL);


kmalloc(a * sizeof(b), GFP) -> kmalloc_array(a, sizeof(b), GFP)
kzalloc(a * sizeof(b), GFP) -> kcalloc(a, sizeof(b), GFP)



      reply	other threads:[~2014-06-16 18:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-16 18:12 Fabian Frederick
2014-06-16 18:37 ` Joe Perches [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=1402943866.3182.4.camel@joe-AO725 \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=fabf@skynet.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phillip@squashfs.org.uk \
    /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

all inboxes | Powered by JetHome®