From owner-svn-src-head@freebsd.org Fri Jan 19 14:50:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40268EB64EF; Fri, 19 Jan 2018 14:50:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19E7484DED; Fri, 19 Jan 2018 14:50:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69AB76D46; Fri, 19 Jan 2018 14:50:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0JEortb046788; Fri, 19 Jan 2018 14:50:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0JEorAI046787; Fri, 19 Jan 2018 14:50:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801191450.w0JEorAI046787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 19 Jan 2018 14:50:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328164 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 328164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2018 14:50:54 -0000 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)