lkml.org 
[lkml]   [2007]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: kfree(0) - ok?

On Aug 17 2007 11:22, Andrew Morton wrote:

>Which is getting pretty idiotic:
>
>akpm:/usr/src/25> grep ZERO_OR_NULL_PTR */*.c
>mm/slab.c: BUG_ON(ZERO_OR_NULL_PTR(cachep->slabp_cache));
>mm/slab.c: if (unlikely(ZERO_OR_NULL_PTR(cachep)))
>mm/slab.c: if (unlikely(ZERO_OR_NULL_PTR(cachep)))
>mm/slab.c: if (unlikely(ZERO_OR_NULL_PTR(objp)))
>mm/slab.c: if (unlikely(ZERO_OR_NULL_PTR(objp)))
>mm/slob.c: if (unlikely(ZERO_OR_NULL_PTR(block)))
>mm/slob.c: if (unlikely(ZERO_OR_NULL_PTR(block)))
>mm/slob.c: if (unlikely(ZERO_OR_NULL_PTR(block)))
>mm/slub.c: if (unlikely(ZERO_OR_NULL_PTR(s)))
>mm/slub.c: if (unlikely(ZERO_OR_NULL_PTR(s)))
>mm/slub.c: if (unlikely(ZERO_OR_NULL_PTR(object)))
>mm/slub.c: if (unlikely(ZERO_OR_NULL_PTR(x)))
>mm/slub.c: if (unlikely(ZERO_OR_NULL_PTR(s)))
>mm/slub.c: if (unlikely(ZERO_OR_NULL_PTR(s)))
>
>are we seeing a pattern here? We could stick the unlikely inside
>ZERO_OR_NULL_PTR() itself.

Yeah,

BUG_ON(unlikely(ZERO_OR_NULL_PTR(..)))

that will really help the bug - "hm, it's Friday, let's BUG" ;-)



Jan
--
-
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/

\
 
 \ /
  Last update: 2007-08-17 20:59    [W:1.412 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site