[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1402943866.3182.4.camel@joe-AO725>
Date: Mon, 16 Jun 2014 11:37:46 -0700
From: Joe Perches <joe@...ches.com>
To: Fabian Frederick <fabf@...net.be>
Cc: linux-kernel@...r.kernel.org,
Phillip Lougher <phillip@...ashfs.org.uk>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 1/1] fs/squashfs/file_direct.c: replace count*size
kmalloc by kcalloc
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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists