projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d5c9e7
)
fs/ntfs3: Use kmalloc_array for allocating multiple elements
author
Kenneth Lee
<klee33@uw.edu>
Fri, 19 Aug 2022 05:51:17 +0000
(22:51 -0700)
committer
Konstantin Komarov
<almaz.alexandrovich@paragon-software.com>
Fri, 30 Sep 2022 14:39:51 +0000
(17:39 +0300)
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>
fs/ntfs3/bitmap.c
patch
|
blob
|
history
diff --git
a/fs/ntfs3/bitmap.c
b/fs/ntfs3/bitmap.c
index 5d44ceac855b7477afc0aa5e8e418bea881fd070..1675c9a6978843073bad8662f26a36692262d341 100644
(file)
--- 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;