On Fri, 1 Jun 2007, Andrew Morton wrote: > I think it'd be better if we kept the WARN_ON_ONCE(size == 0) in there, The trouble with the WARN_ON is that it triggers even for code that is okay like noted by Jeremy. My initial intend with NULL was to allow the allocation of a zero sized pointer without extra checks. It should only trigger a failure if something bad was done. NULL had the problem of confusion with no memory available. I think BADPTR is good. If the coding warts are causing trouble then BADPTR will result in a failure. Otherwise if the code is doing a kmalloc(0) and not dereferencing the pointer (like Paul's fixed code) then we should be fine and not issue a warning. The false positives may be upsetting some people. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Linus Torvalds <[email protected]>
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- References:
- [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Srinivasa Ds <[email protected]>
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Srinivasa Ds <[email protected]>
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Jeremy Fitzhardinge <[email protected]>
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Christoph Lameter <[email protected]>
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Andrew Morton <[email protected]>
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Christoph Lameter <[email protected]>
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Andrew Morton <[email protected]>
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Christoph Lameter <[email protected]>
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Andrew Morton <[email protected]>
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Christoph Lameter <[email protected]>
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Linus Torvalds <[email protected]>
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Christoph Lameter <[email protected]>
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Linus Torvalds <[email protected]>
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Christoph Lameter <[email protected]>
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Linus Torvalds <[email protected]>
- Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- From: Andrew Morton <[email protected]>
- [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- Prev by Date: Re: Device hang when offlining a CPU due to IRQ misrouting
- Next by Date: Re: A kexec approach to hibernation
- Previous by thread: Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- Next by thread: Re: [RFC] [PATCH] cpuset operations causes Badness at mm/slab.c:777 warning
- Index(es):