X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=mm%2Fslob.c;h=91bd3f2dd2f02622d6aa32802d2bdcd70ee922bd;hb=ffd756b3174e496cf6f3c5458c434e31d2cd48b0;hp=eeed4a05a2ef2ffa3f7fc1b3ff1ccada895f3e77;hpb=f6c0ffa8f0b0781f4954cb06f0a81d6c10c1b434;p=cascardo%2Flinux.git diff --git a/mm/slob.c b/mm/slob.c index eeed4a05a2ef..91bd3f2dd2f0 100644 --- 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);