]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/slob.c
Merge branch 'slab/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penber...
[karo-tx-linux.git] / mm / slob.c
index eeed4a05a2ef2ffa3f7fc1b3ff1ccada895f3e77..91bd3f2dd2f02622d6aa32802d2bdcd70ee922bd 100644 (file)
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -122,7 +122,7 @@ static inline void clear_slob_page_free(struct page *sp)
 }
 
 #define SLOB_UNIT sizeof(slob_t)
-#define SLOB_UNITS(size) (((size) + SLOB_UNIT - 1)/SLOB_UNIT)
+#define SLOB_UNITS(size) DIV_ROUND_UP(size, SLOB_UNIT)
 
 /*
  * struct slob_rcu is inserted at the tail of allocated slob blocks, which
@@ -554,7 +554,7 @@ void *kmem_cache_alloc_node(struct kmem_cache *c, gfp_t flags, int node)
                                            flags, node);
        }
 
-       if (c->ctor)
+       if (b && c->ctor)
                c->ctor(b);
 
        kmemleak_alloc_recursive(b, c->size, 1, c->flags, flags);