aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Lee <[email protected]>2022-08-18 22:51:17 -0700
committerKonstantin Komarov <[email protected]>2022-09-30 17:39:51 +0300
commit92f017c4aee6e2bb79593adeacccbea3afe62223 (patch)
tree0395b4fccb3bda4ad1e37ab0ce54d17d54c1d94c
parent6d5c9e79b726cc473d40e9cb60976dbe8e669624 (diff)
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 <[email protected]> Signed-off-by: Konstantin Komarov <[email protected]>
-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;