svn commit: r327788 - head/sys/compat/linuxkpi/common/include/linux
Pedro F. Giffuni
pfg at FreeBSD.org
Wed Jan 10 20:50:07 UTC 2018
Author: pfg
Date: Wed Jan 10 20:50:06 2018
New Revision: 327788
URL: https://svnweb.freebsd.org/changeset/base/327788
Log:
linuxkpi: Simplify kmalloc_array.
kmalloc_array seems what we call mallocarray(9).
Modified:
head/sys/compat/linuxkpi/common/include/linux/slab.h
Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/slab.h Wed Jan 10 20:49:01 2018 (r327787)
+++ head/sys/compat/linuxkpi/common/include/linux/slab.h Wed Jan 10 20:50:06 2018 (r327788)
@@ -121,9 +121,7 @@ vmalloc_32(size_t size)
static inline void *
kmalloc_array(size_t n, size_t size, gfp_t flags)
{
- if (size != 0 && n > (SIZE_MAX / size))
- return (NULL);
- return (malloc(n * size, M_KMALLOC, linux_check_m_flags(flags)));
+ return (mallocarray(n, size, M_KMALLOC, linux_check_m_flags(flags)));
}
static inline void *
More information about the svn-src-all
mailing list