mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
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>
This commit is contained in:
parent
6d5c9e79b7
commit
92f017c4ae
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user