From owner-svn-src-stable@FreeBSD.ORG Fri Oct 22 16:00:04 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 385FE10656E6; Fri, 22 Oct 2010 16:00: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 177188FC15; Fri, 22 Oct 2010 16:00:01 +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 o9MG003I059123; Fri, 22 Oct 2010 16:00:00 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9MG00a7059121; Fri, 22 Oct 2010 16:00:00 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201010221600.o9MG00a7059121@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 22 Oct 2010 16:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214206 - in stable/8: share/man/man9 sys/vm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Oct 2010 16:00:04 -0000 Author: mdf Date: Fri Oct 22 16:00:00 2010 New Revision: 214206 URL: http://svn.freebsd.org/changeset/base/214206 Log: MFC r214062: uma_zfree(zone, NULL) should do nothing, to match free(9). Noticed by: Ron Steinke Modified: stable/8/share/man/man9/zone.9 stable/8/sys/vm/uma_core.c Directory Properties: stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/share/man/man9/zone.9 ============================================================================== --- stable/8/share/man/man9/zone.9 Fri Oct 22 14:07:12 2010 (r214205) +++ stable/8/share/man/man9/zone.9 Fri Oct 22 16:00:00 2010 (r214206) @@ -147,6 +147,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: stable/8/sys/vm/uma_core.c ============================================================================== --- stable/8/sys/vm/uma_core.c Fri Oct 22 14:07:12 2010 (r214205) +++ stable/8/sys/vm/uma_core.c Fri Oct 22 16:00:00 2010 (r214206) @@ -2519,6 +2519,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);