summaryrefslogtreecommitdiff
path: root/fs/ntfs3/frecord.c
diff options
context:
space:
mode:
authorKari Argillander <kari.argillander@gmail.com>2021-08-24 21:37:08 +0300
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2021-08-27 17:05:13 +0300
commit345482bc431f6492beb464696341626057f67771 (patch)
tree7f5c20859d0d7834e38c2e67c3a7ce85adf8b52d /fs/ntfs3/frecord.c
parent195c52bdd5d5ecfdabf5a7c6159efe299e534f84 (diff)
fs/ntfs3: Use kcalloc/kmalloc_array over kzalloc/kmalloc
Use kcalloc/kmalloc_array over kzalloc/kmalloc when we allocate array. Checkpatch found these after we did not use our own defined allocation wrappers. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kari Argillander <kari.argillander@gmail.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/frecord.c')
-rw-r--r--fs/ntfs3/frecord.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 2f7d16543530..329bc76dfb09 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -2054,7 +2054,7 @@ int ni_readpage_cmpr(struct ntfs_inode *ni, struct page *page)
idx = (vbo - frame_vbo) >> PAGE_SHIFT;
pages_per_frame = frame_size >> PAGE_SHIFT;
- pages = kzalloc(pages_per_frame * sizeof(struct page *), GFP_NOFS);
+ pages = kcalloc(pages_per_frame, sizeof(struct page *), GFP_NOFS);
if (!pages) {
err = -ENOMEM;
goto out;
@@ -2137,7 +2137,7 @@ int ni_decompress_file(struct ntfs_inode *ni)
frame_bits = ni_ext_compress_bits(ni);
frame_size = 1u << frame_bits;
pages_per_frame = frame_size >> PAGE_SHIFT;
- pages = kzalloc(pages_per_frame * sizeof(struct page *), GFP_NOFS);
+ pages = kcalloc(pages_per_frame, sizeof(struct page *), GFP_NOFS);
if (!pages) {
err = -ENOMEM;
goto out;
@@ -2709,8 +2709,7 @@ int ni_write_frame(struct ntfs_inode *ni, struct page **pages,
goto out;
}
- pages_disk = kzalloc(pages_per_frame * sizeof(struct page *),
- GFP_NOFS);
+ pages_disk = kcalloc(pages_per_frame, sizeof(struct page *), GFP_NOFS);
if (!pages_disk) {
err = -ENOMEM;
goto out;