Skip to content

Commit a3d2182

Browse files
ubifs: Use kmalloc_array()
Since commit 6da2ec5 ("treewide: kmalloc() -> kmalloc_array()") we use kmalloc_array() for kmalloc() that computes the length with a multiplication. Cc: Kees Cook <[email protected]> Suggested-by: Kees Cook <[email protected]> Signed-off-by: Richard Weinberger <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 95a22d2 commit a3d2182

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ubifs/journal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ static int truncate_data_node(const struct ubifs_info *c, const struct inode *in
12911291
int err, dlen, compr_type, out_len, old_dlen;
12921292

12931293
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);
12951295
if (!buf)
12961296
return -ENOMEM;
12971297

0 commit comments

Comments
 (0)