]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - lib/genalloc.c
lib/genalloc.c: use vzalloc_node() to allocate the bitmap
[mirror_ubuntu-bionic-kernel.git] / lib / genalloc.c
index 5deb25c40a5a144fd4d85dc93522fe5f307cc934..f365d71cdc774c089cfdce89b1aec1facb3a0b05 100644 (file)
@@ -187,7 +187,7 @@ int gen_pool_add_virt(struct gen_pool *pool, unsigned long virt, phys_addr_t phy
        int nbytes = sizeof(struct gen_pool_chunk) +
                                BITS_TO_LONGS(nbits) * sizeof(long);
 
-       chunk = kzalloc_node(nbytes, GFP_KERNEL, nid);
+       chunk = vzalloc_node(nbytes, nid);
        if (unlikely(chunk == NULL))
                return -ENOMEM;
 
@@ -251,7 +251,7 @@ void gen_pool_destroy(struct gen_pool *pool)
                bit = find_next_bit(chunk->bits, end_bit, 0);
                BUG_ON(bit < end_bit);
 
-               kfree(chunk);
+               vfree(chunk);
        }
        kfree_const(pool->name);
        kfree(pool);