OSDN Git Service

kasan: allow enabling KASAN_VMALLOC and SW/HW_TAGS
[uclinux-h8/linux.git] / kernel / audit_tree.c
index 72324af..e7315d4 100644 (file)
@@ -94,7 +94,7 @@ static struct audit_tree *alloc_tree(const char *s)
 {
        struct audit_tree *tree;
 
-       tree = kmalloc(sizeof(struct audit_tree) + strlen(s) + 1, GFP_KERNEL);
+       tree = kmalloc(struct_size(tree, pathname, strlen(s) + 1), GFP_KERNEL);
        if (tree) {
                refcount_set(&tree->count, 1);
                tree->goner = 0;