]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - kernel/groups.c
genirq/affinity: Consider that CPUs on nodes can be unbalanced
[mirror_ubuntu-jammy-kernel.git] / kernel / groups.c
index fe7e6385530e679596009b2e125cb808397d870f..787b381c7c0026c31793ab1ebd0c2383ced820f0 100644 (file)
 struct group_info *groups_alloc(int gidsetsize)
 {
        struct group_info *gi;
-       unsigned int len;
-
-       len = sizeof(struct group_info) + sizeof(kgid_t) * gidsetsize;
-       gi = kmalloc(len, GFP_KERNEL_ACCOUNT|__GFP_NOWARN|__GFP_NORETRY);
-       if (!gi)
-               gi = __vmalloc(len, GFP_KERNEL_ACCOUNT);
+       gi = kvmalloc(struct_size(gi, gid, gidsetsize), GFP_KERNEL_ACCOUNT);
        if (!gi)
                return NULL;