Merge branch 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuil...
[linux-drm-fsl-dcu.git] / net / xfrm / xfrm_hash.c
index 37643bb8768a83fe6bea2bb40a007cc2a78ee503..a2023ec52329ef66b95e14dc94f7086e5683e534 100644 (file)
@@ -17,15 +17,13 @@ struct hlist_head *xfrm_hash_alloc(unsigned int sz)
        struct hlist_head *n;
 
        if (sz <= PAGE_SIZE)
-               n = kmalloc(sz, GFP_KERNEL);
+               n = kzalloc(sz, GFP_KERNEL);
        else if (hashdist)
-               n = __vmalloc(sz, GFP_KERNEL, PAGE_KERNEL);
+               n = __vmalloc(sz, GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL);
        else
                n = (struct hlist_head *)
-                       __get_free_pages(GFP_KERNEL, get_order(sz));
-
-       if (n)
-               memset(n, 0, sz);
+                       __get_free_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO,
+                                        get_order(sz));
 
        return n;
 }