Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jan 2018 14:50:53 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328164 - head/sys/contrib/libnv
Message-ID:  <201801191450.w0JEorAI046787@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801191450.w0JEorAI046787>