diff options
author | Matthew Wilcox <mawilcox@microsoft.com> | 2018-06-07 17:57:19 +0300 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2018-06-13 02:19:22 +0300 |
commit | a3ac973076df54493bfcfa95f186907c7dba6ed2 (patch) | |
tree | 24046fc706aa00b83e6f28b3024e15f0bbb4b7bf /fs/jffs2/acl.c | |
parent | b2303d7bf76d36a5176c793df628d302be29ab82 (diff) | |
download | linux-a3ac973076df54493bfcfa95f186907c7dba6ed2.tar.xz |
Convert jffs2 acl to struct_size
Need to tell the compiler that the acl entries follow the acl header.
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'fs/jffs2/acl.c')
-rw-r--r-- | fs/jffs2/acl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c index 7ebacf14837f..093ffbd82395 100644 --- a/fs/jffs2/acl.c +++ b/fs/jffs2/acl.c @@ -133,7 +133,8 @@ static void *jffs2_acl_to_medium(const struct posix_acl *acl, size_t *size) size_t i; *size = jffs2_acl_size(acl->a_count); - header = kmalloc(sizeof(*header) + acl->a_count * sizeof(*entry), GFP_KERNEL); + header = kmalloc(struct_size(header, a_entries, acl->a_count), + GFP_KERNEL); if (!header) return ERR_PTR(-ENOMEM); header->a_version = cpu_to_je32(JFFS2_ACL_VERSION); |