author: Kees Cook <keescook@chromium.org> 2018-06-12 14:27:37 -0700
committer: Kees Cook <keescook@chromium.org> 2018-06-12 16:19:22 -0700
commit: fad953ce0b22cfd352a9a90b070c34b8791e6868
parent: 42bc47b35320e0e587a88e437e18f80f9c5bcbb2
Commit Summary:
Diffstat:
2 files changed, 4 insertions, 2 deletions
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 358ee2a1ce1a..52eb5d293a34 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -350,7 +350,8 @@ static struct reiserfs_journal_cnode *allocate_cnodes(int num_cnodes)
if (num_cnodes <= 0) {
return NULL;
}
- head = vzalloc(num_cnodes * sizeof(struct reiserfs_journal_cnode));
+ head = vzalloc(array_size(num_cnodes,
+ sizeof(struct reiserfs_journal_cnode)));
if (!head) {
return NULL;
}
diff --git a/fs/reiserfs/resize.c b/fs/reiserfs/resize.c
index 6052d323bc9a..8096c74c38ac 100644
--- a/fs/reiserfs/resize.c
+++ b/fs/reiserfs/resize.c
@@ -120,7 +120,8 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new)
* array of bitmap block pointers
*/
bitmap =
- vzalloc(sizeof(struct reiserfs_bitmap_info) * bmap_nr_new);
+ vzalloc(array_size(bmap_nr_new,
+ sizeof(struct reiserfs_bitmap_info)));
if (!bitmap) {
/*
* Journal bitmaps are still supersized, but the