mm: Introduce kvcalloc()
The kv*alloc()-family was missing kvcalloc(). Adding this allows for 2-argument multiplication conversions of kvzalloc(a * b, ...) into kvcalloc(a, b, ...). Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
This commit is contained in:
committed by
UtsavBalar1231
parent
455b230d63
commit
ca3a48c281
@@ -571,6 +571,11 @@ static inline void *kvmalloc_array(size_t n, size_t size, gfp_t flags)
|
||||
return kvmalloc(n * size, flags);
|
||||
}
|
||||
|
||||
static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
|
||||
{
|
||||
return kvmalloc_array(n, size, flags | __GFP_ZERO);
|
||||
}
|
||||
|
||||
extern void kvfree(const void *addr);
|
||||
extern void kvfree_sensitive(const void *addr, size_t len);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user