Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758509Ab2BIXI6 (ORCPT ); Thu, 9 Feb 2012 18:08:58 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:56744 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758450Ab2BIXI5 (ORCPT ); Thu, 9 Feb 2012 18:08:57 -0500 Date: Thu, 9 Feb 2012 15:08:56 -0800 From: Andrew Morton To: David Rientjes Cc: Xi Wang , Jens Axboe , Pekka Enberg , Dan Carpenter , linux-kernel@vger.kernel.org, Christoph Lameter , Matt Mackall Subject: Re: [PATCH RFC v2] slab: introduce kmalloc_array Message-Id: <20120209150856.7f97d28e.akpm@linux-foundation.org> In-Reply-To: References: <20120207141155.GA16184@elgon.mountain> <4F323388.7040902@kernel.dk> <20120208142513.4db2493a.akpm@linux-foundation.org> <4F33BF05.208@gmail.com> <4F33C7D7.1060801@kernel.dk> <32FA0BD0-7C0D-4ED4-B375-4736FC70AC05@gmail.com> <4F33CEAE.60400@gmail.com> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1120 Lines: 30 On Thu, 9 Feb 2012 14:42:49 -0800 (PST) David Rientjes wrote: > On Thu, 9 Feb 2012, Xi Wang wrote: > > > This patch introduces a kmalloc_array() wrapper that performs integer > > overflow checking without zeroing the memory. > > > > Suggested-by: Andrew Morton > > Suggested-by: Jens Axboe > > Signed-off-by: Xi Wang > > Acked-by: David Rientjes > > assuming there's at least one new user or one existing user that can be > modified to use the new interface and this won't just sit around not being > used. The need is there - I've whined about the absence of kmalloc_array() maybe 3 times in the past year. Often kcalloc() is suitable - quite a lot of arrays which are sized based on a userspace-provided dimension are also zeroed out. For some reason. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/