From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail203.messagelabs.com (mail203.messagelabs.com [216.82.254.243]) by kanga.kvack.org (Postfix) with ESMTP id A59B36B0012 for ; Fri, 6 May 2011 20:03:55 -0400 (EDT) Received: by gwaa12 with SMTP id a12so1865717gwa.14 for ; Fri, 06 May 2011 17:03:53 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: Date: Sat, 7 May 2011 03:03:53 +0300 Message-ID: Subject: Re: [PATCH] slub: slub_def.h: needs additional check for "index" From: Maxin John Content-Type: text/plain; charset=ISO-8859-1 Sender: owner-linux-mm@kvack.org List-ID: To: Christoph Lameter Cc: Pekka Enberg , Matt Mackall , linux-mm@kvack.org, linux-kernel@vger.kernel.org Hi, On Fri, May 6, 2011 at 9:56 PM, Christoph Lameter wrote: > The value passed to kmalloc_slab is tested before the result is used. > kmalloc_slab() only returns -1 for values > 4MB. > > The size of the object is checked against SLUB_MAX size which is > significantly smaller than 4MB. 8kb by default. > > So kmalloc_slab() cannot return -1 if the parameter is checked first. Thank you very much for pointing it out. I think it's a lot more clear for me now. Best Regards, Maxin -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org