From owner-svn-src-all@FreeBSD.ORG Tue Oct 19 16:06:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 092DA106564A; Tue, 19 Oct 2010 16:06:01 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB7AB8FC19; Tue, 19 Oct 2010 16:06:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9JG604p019822; Tue, 19 Oct 2010 16:06:00 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9JG60DC019819; Tue, 19 Oct 2010 16:06:00 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201010191606.o9JG60DC019819@svn.freebsd.org> From: Matthew D Fleming Date: Tue, 19 Oct 2010 16:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214062 - in head: share/man/man9 sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Oct 2010 16:06:01 -0000 Author: mdf Date: Tue Oct 19 16:06:00 2010 New Revision: 214062 URL: http://svn.freebsd.org/changeset/base/214062 Log: uma_zfree(zone, NULL) should do nothing, to match free(9). Noticed by: Ron Steinke MFC after: 3 days Modified: head/share/man/man9/zone.9 head/sys/vm/uma_core.c Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Tue Oct 19 15:26:08 2010 (r214061) +++ head/share/man/man9/zone.9 Tue Oct 19 16:06:00 2010 (r214062) @@ -153,6 +153,13 @@ Items are released back to the zone from calling .Fn uma_zfree with a pointer to the zone and a pointer to the item. +If +.Fa item +is +.Dv NULL , +then +.Fn uma_zfree +does nothing. .Pp The variations .Fn uma_zalloc_arg Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Oct 19 15:26:08 2010 (r214061) +++ head/sys/vm/uma_core.c Tue Oct 19 16:06:00 2010 (r214062) @@ -2517,6 +2517,10 @@ uma_zfree_arg(uma_zone_t zone, void *ite CTR2(KTR_UMA, "uma_zfree_arg thread %x zone %s", curthread, zone->uz_name); + /* uma_zfree(..., NULL) does nothing, to match free(9). */ + if (item == NULL) + return; + if (zone->uz_dtor) zone->uz_dtor(item, zone->uz_size, udata);