svn commit: r328164 - head/sys/contrib/libnv

Pedro F. Giffuni pfg at FreeBSD.org
Fri Jan 19 14:50:54 UTC 2018


Author: pfg
Date: Fri Jan 19 14:50:53 2018
New Revision: 328164
URL: https://svnweb.freebsd.org/changeset/base/328164

Log:
  libnv: Use mallocarray(9) for the nv_calloc.

Modified:
  head/sys/contrib/libnv/nv_impl.h

Modified: head/sys/contrib/libnv/nv_impl.h
==============================================================================
--- head/sys/contrib/libnv/nv_impl.h	Fri Jan 19 13:06:36 2018	(r328163)
+++ head/sys/contrib/libnv/nv_impl.h	Fri Jan 19 14:50:53 2018	(r328164)
@@ -51,7 +51,7 @@ typedef struct nvpair nvpair_t;
 
 #ifdef _KERNEL
 #define	nv_malloc(size)			malloc((size), M_NVLIST, M_WAITOK)
-#define	nv_calloc(n, size)		malloc((n) * (size), M_NVLIST, \
+#define	nv_calloc(n, size)		mallocarray((n), (size), M_NVLIST, \
 					    M_WAITOK | M_ZERO)
 #define	nv_realloc(buf, size)		realloc((buf), (size), M_NVLIST, \
 					    M_WAITOK)


More information about the svn-src-all mailing list