From owner-freebsd-current Sun Oct 20 14:57:15 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CDA3337B401; Sun, 20 Oct 2002 14:57:14 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3AD8A43EA9; Sun, 20 Oct 2002 14:57:14 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.3/8.12.3) with ESMTP id g9KLv9pk076841; Sun, 20 Oct 2002 15:57:10 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 20 Oct 2002 15:56:57 -0600 (MDT) Message-Id: <20021020.155657.10475080.imp@bsdimp.com> To: tlambert2@mindspring.com Cc: jake@locore.ca, ben@stuyts.nl, current@FreeBSD.ORG, jroberson@chesapeake.net, rwatson@FreeBSD.ORG, jeff@FreeBSD.ORG, alfred@FreeBSD.ORG Subject: Re: [Ugly PATCH] Again: panic kmem_malloc() From: "M. Warner Losh" In-Reply-To: <3DB31925.7B70E70@mindspring.com> References: <20021018213608.A60569@locore.ca> <20021020.125308.35255652.imp@bsdimp.com> <3DB31925.7B70E70@mindspring.com> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <3DB31925.7B70E70@mindspring.com> Terry Lambert writes: : "M. Warner Losh" wrote: : > : + if (sops) : > : + free(sops, M_SEM); : > : > The kernel free() groks free(NULL, M_FOO), so the if isn't needed. : : Wow. That's bogus. It should panic. It isn't bogus. free(NULL) is defined to be OK in ansi-c. The kernel just mirrors that. : Or we should fix all of libc to take NULL arguments for strings, : and treat them as if they were actually "". That's bogus. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message