LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jan Engelhardt <jengelh@linux01.gwdg.de>
To: Stephane Eranian <eranian@hpl.hp.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, ak@suse.de
Subject: Re: kmalloc() with size zero
Date: Fri, 23 Mar 2007 02:38:25 +0100 (MET)	[thread overview]
Message-ID: <Pine.LNX.4.61.0703230237390.9555@yvahk01.tjqt.qr> (raw)
In-Reply-To: <20070323001824.GA26540@frankl.hpl.hp.com>


On Mar 22 2007 16:18, Stephane Eranian wrote:
>
>Hello,
>
>I ran into an issue with perfmon where I ended up calling
>kmalloc() with a size of zero. To my surprise, this did
>not return NULL but a valid data address.
>
>I am wondering if this is a property of kmalloc() or simply
>a bug. It is the case that the __kmalloc() code does not
>check for zero size.

I'd say "feature", glibc's malloc also returns an address on malloc(0).


Jan
-- 

  reply	other threads:[~2007-03-23  1:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-23  0:18 Stephane Eranian
2007-03-23  1:38 ` Jan Engelhardt [this message]
2007-03-23  4:39   ` Vignesh Babu BM
2007-03-25 16:30     ` Folkert van Heusden
2007-03-26  8:09       ` Stephane Eranian
2007-03-29 14:39         ` Bill Davidsen
2007-03-23 15:12 ` Christoph Lameter

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=Pine.LNX.4.61.0703230237390.9555@yvahk01.tjqt.qr \
    --to=jengelh@linux01.gwdg.de \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=eranian@hpl.hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: kmalloc() with size zero' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).