summaryrefslogtreecommitdiffstats
path: root/fs/ntfs3
diff options
context:
space:
mode:
authorKenneth Lee <klee33@uw.edu>2022-08-19 07:51:17 +0200
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2022-09-30 16:39:51 +0200
commit92f017c4aee6e2bb79593adeacccbea3afe62223 (patch)
tree0395b4fccb3bda4ad1e37ab0ce54d17d54c1d94c /fs/ntfs3
parentfs/ntfs3: Fix attr_punch_hole() null pointer derenference (diff)
downloadlinux-92f017c4aee6e2bb79593adeacccbea3afe62223.tar.xz
linux-92f017c4aee6e2bb79593adeacccbea3afe62223.zip
fs/ntfs3: Use kmalloc_array for allocating multiple elements
Prefer using kmalloc_array(a, b) over kmalloc(a * b) as this improves semantics since kmalloc is intended for allocating an array of memory. Signed-off-by: Kenneth Lee <klee33@uw.edu> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3')
-rw-r--r--fs/ntfs3/bitmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ntfs3/bitmap.c b/fs/ntfs3/bitmap.c
index 5d44ceac855b..1675c9a69788 100644
--- a/fs/ntfs3/bitmap.c
+++ b/fs/ntfs3/bitmap.c
@@ -1324,7 +1324,7 @@ int wnd_extend(struct wnd_bitmap *wnd, size_t new_bits)
new_last = wbits;
if (new_wnd != wnd->nwnd) {
- new_free = kmalloc(new_wnd * sizeof(u16), GFP_NOFS);
+ new_free = kmalloc_array(new_wnd, sizeof(u16), GFP_NOFS);
if (!new_free)
return -ENOMEM;