Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759365AbXFDRCT (ORCPT ); Mon, 4 Jun 2007 13:02:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757156AbXFDRCM (ORCPT ); Mon, 4 Jun 2007 13:02:12 -0400 Received: from wa-out-1112.google.com ([209.85.146.183]:31077 "EHLO wa-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756785AbXFDRCK (ORCPT ); Mon, 4 Jun 2007 13:02:10 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=tsLNHrCdZcjAn0BBJJtOsHNA+muP0Pc+1ldMEEFVh/+Nhxfp/WKzME+UwkppatV7AfyRjEExvyZr1qnb0PgahBsKBv623BxFkJFXsDW4TUCpdV/nLUJORG3QiYVH6dGZ5daVkLfZC9FXlVzaML2EKtDSAdKZHhn5oJxYUykvYMQ= Message-ID: <84144f020706041002t39142548l29cff861461dd7d7@mail.gmail.com> Date: Mon, 4 Jun 2007 20:02:09 +0300 From: "Pekka Enberg" To: "Roland Dreier" Subject: Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0) Cc: "Linus Torvalds" , "Christoph Lameter" , "Andrew Morton" , linux-kernel@vger.kernel.org, jeremy@goop.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070601213117.1178e8e0.akpm@linux-foundation.org> <84144f020706040808t4882f961t80b8d8eb145bfa50@mail.gmail.com> <84144f020706040922v56cb10eg5a730b4abe9d5251@mail.gmail.com> <84144f020706040937xb06535em543fa887ad65ee8f@mail.gmail.com> X-Google-Sender-Auth: 013bd1156cf9c526 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 759 Lines: 18 On 6/4/07, Roland Dreier wrote: > No, because as was mentioned earlier in the thread, we want code to be > able to handle 0-sized allocations without special cases. The goal is > that code like > > buf = kmalloc(nobj * obj_size); > if (buf == NULL) > return -ENOMEM; > > should work fine if nobj happens to be 0. But we do want to get an > oops if the code actually tries to read or write *buf. Aah, missed that part of the discussion. Sorry for the noise ;-) - 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/