]> err.no Git - linux-2.6/blobdiff - mm/slab.c
Slab allocators: fail if ksize is called with a NULL parameter
[linux-2.6] / mm / slab.c
index 6f6abef83a1af82432305245755ab690c8363081..1b240a3029d658a09ebef73fd91022073aa5a551 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -4446,7 +4446,8 @@ const struct seq_operations slabstats_op = {
  */
 size_t ksize(const void *objp)
 {
-       if (unlikely(ZERO_OR_NULL_PTR(objp)))
+       BUG_ON(!objp);
+       if (unlikely(objp == ZERO_SIZE_PTR))
                return 0;
 
        return obj_size(virt_to_cache(objp));