From owner-freebsd-current@FreeBSD.ORG Mon Oct 18 20:59:19 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09DE91065673 for ; Mon, 18 Oct 2010 20:59:19 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id BB5428FC2E for ; Mon, 18 Oct 2010 20:59:18 +0000 (UTC) Received: by gwb20 with SMTP id 20so782920gwb.13 for ; Mon, 18 Oct 2010 13:59:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=g8uK5nNtzGCWoPUwNqd+UlX1L9nwYSwiK6Sy8psSg94=; b=dXLTGpQ7qri4zHdjuZaTKLY1IngZzkBHP6K4XgyaunzuB1phZlZ3DHLfKgU2ac9PB6 ff6eJfw6qBp/Iq3aVkY+POy8U9+9D/Iu/aQDqo4+2wQTsZkA3gWarLJ/9z0VgRuq7ydd 4WqxSZhdqv6kN5fNLCJuNlTAS2+4wSvHqYlvU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=GdE/hCvR9mhMAHtUyCrjAGeUABYqkXIAi0NpeNmhCKTRsSYfQ3blUAIj5v3Ybkxsob yxUEOV//vHNk8q400su3p4m/5NZ9m9kbiIZKnxApcAvI+ZphnuCiXYuid1xnH2M3TZGg vslxyaLb7aB9GFJXCePOVqSPPJ2GxTozuz8rc= MIME-Version: 1.0 Received: by 10.42.137.195 with SMTP id z3mr3461533ict.152.1287435557743; Mon, 18 Oct 2010 13:59:17 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.231.142.76 with HTTP; Mon, 18 Oct 2010 13:59:17 -0700 (PDT) Date: Mon, 18 Oct 2010 13:59:17 -0700 X-Google-Sender-Auth: z0g8mVg6XMxINOjADyaVPfTvJ3U Message-ID: From: mdf@FreeBSD.org To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: uma_zfree(NULL) is broken X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Oct 2010 20:59:19 -0000 There's explicit protection for free(NULL, M_FOO), but uma_zfree(zone, NULL) will put NULL in the local bucket and then probably return it later from a uma_zalloc call. Obviously it's not a good idea to call uma_zfree(9) on NULL, but in this case it's an easy mistake to make when e.g. converting a set of malloc(9)/free(9) uses into uma(9). So is the "right" thing to allow a uma_zfree(NULL) and silently succeed, like for free(9)? That would be my guess, but I'm open to alternatives. Thanks, matthew