未验证 提交 92f017c4 编写于 作者: K Kenneth Lee 提交者: Konstantin Komarov

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: NKenneth Lee <klee33@uw.edu>
Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
上级 6d5c9e79
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册