forked from Minki/linux
ubifs: Use kmalloc_array()
Since commit 6da2ec5605
("treewide: kmalloc() -> kmalloc_array()")
we use kmalloc_array() for kmalloc() that computes the length with
a multiplication.
Cc: Kees Cook <keescook@chromium.org>
Suggested-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
parent
95a22d2084
commit
a3d218280c
@ -1291,7 +1291,7 @@ static int truncate_data_node(const struct ubifs_info *c, const struct inode *in
|
||||
int err, dlen, compr_type, out_len, old_dlen;
|
||||
|
||||
out_len = le32_to_cpu(dn->size);
|
||||
buf = kmalloc(out_len * WORST_COMPR_FACTOR, GFP_NOFS);
|
||||
buf = kmalloc_array(out_len, WORST_COMPR_FACTOR, GFP_NOFS);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user