diff options
author | Richard Weinberger <richard@nod.at> | 2018-07-02 17:47:13 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2018-08-14 18:25:20 -0400 |
commit | a3d218280c273f298b0a17902bc2b4aa3f1dae06 (patch) | |
tree | fafbd048d6f7c1d50bbe1c686f0ae1751c21373f | |
parent | 95a22d2084d72ea067d8323cc85677dba5d97cae (diff) |
ubifs: Use kmalloc_array()
Since commit 6da2ec56059c ("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>
-rw-r--r-- | fs/ubifs/journal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index cef0d76d490a..42ba4ceb81ee 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c | |||
@@ -1291,7 +1291,7 @@ static int truncate_data_node(const struct ubifs_info *c, const struct inode *in | |||
1291 | int err, dlen, compr_type, out_len, old_dlen; | 1291 | int err, dlen, compr_type, out_len, old_dlen; |
1292 | 1292 | ||
1293 | out_len = le32_to_cpu(dn->size); | 1293 | out_len = le32_to_cpu(dn->size); |
1294 | buf = kmalloc(out_len * WORST_COMPR_FACTOR, GFP_NOFS); | 1294 | buf = kmalloc_array(out_len, WORST_COMPR_FACTOR, GFP_NOFS); |
1295 | if (!buf) | 1295 | if (!buf) |
1296 | return -ENOMEM; | 1296 | return -ENOMEM; |
1297 | 1297 | ||